Skip to content

Commit 1031a26

Browse files
committed
feat: update deck to the latest version
1 parent 144f2d8 commit 1031a26

File tree

147 files changed

+284
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+284
-1
lines changed

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/1 - What are the possible ways to create objec.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ There are many ways to create objects in javascript as mentioned below:
6363
value: 'Golf',
6464
},
6565
};
66+
6667
var car = Object.create(vehicle, carProps);
6768
console.log(car);
6869
```
@@ -93,6 +94,7 @@ There are many ways to create objects in javascript as mentioned below:
9394

9495
```javascript
9596
function func() {}
97+
9698
new func(x, y, z);
9799
```
98100

@@ -101,8 +103,10 @@ There are many ways to create objects in javascript as mentioned below:
101103
```javascript
102104
// Create a new instance using function prototype.
103105
var newInstance = Object.create(func.prototype)
106+
104107
// Call the function
105108
var result = func.call(newInstance, x, y, z),
109+
106110
// If the result is a non-null object then use it otherwise just use the new instance.
107111
console.log(result && typeof result === 'object' ? result : newInstance);
108112
```
@@ -129,6 +133,7 @@ There are many ways to create objects in javascript as mentioned below:
129133
this.name = name;
130134
}
131135
}
136+
132137
var object = new Person('Sudheer');
133138
```
134139

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/103 - What is the use of stoppropagation method.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ The stopPropagation method is used to stop the event from bubbling up the event
1111
<div onclick="secondFunc()">DIV 2
1212
<div onclick="firstFunc(event)">DIV 1</div>
1313
</div>
14+
1415
<script>
1516
function firstFunc(event) {
1617
alert("DIV 1");
1718
event.stopPropagation();
1819
}
20+
1921
function secondFunc() {
2022
alert("DIV 2");
2123
}

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/109 - What is an event delegation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ For example, if you wanted to detect field changes in inside a specific form, yo
1010

1111
```javascript
1212
var form = document.querySelector('#registration-form');
13+
1314
// Listen for changes to fields inside the form
1415
form.addEventListener(
1516
'input',

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/117 - What is the purpose of cleartimeout method.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ function greeting() {
1616
}
1717
function start() {
1818
msg =setTimeout(greeting, 3000);
19+
1920
}
21+
2022
function stop() {
2123
clearTimeout(msg);
2224
}

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/118 - What is the purpose of clearinterval metho.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ function greeting() {
1616
}
1717
function start() {
1818
msg = setInterval(greeting, 3000);
19+
1920
}
21+
2022
function stop() {
2123
clearInterval(msg);
2224
}

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/125 - How do you check if a key exists in an obj.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ obj.hasOwnProperty('key'); // true
3030
const user = {
3131
name: 'John',
3232
};
33+
3334
console.log(user.name !== undefined); // true
3435
console.log(user.nickName !== undefined); // false
3536
```

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/126 - How do you loop through or enumerate javas.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var object = {
1212
k2: 'value2',
1313
k3: 'value3',
1414
};
15+
1516
for (var key in object) {
1617
if (object.hasOwnProperty(key)) {
1718
console.log(key + ' -> ' + object[key]); // k1 -> value1 ...

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/127 - How do you test for an empty object.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ function isEmpty(obj) {
2727
return false;
2828
}
2929
}
30+
3031
return JSON.stringify(obj) === JSON.stringify({});
3132
}
3233
```

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/128 - What is an arguments object.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function sum() {
1414
}
1515
return total;
1616
}
17+
1718
sum(1, 2, 3); // returns 6
1819
```
1920

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/131 - How do you display the current date in jav.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var today = new Date();
1111
var dd = String(today.getDate()).padStart(2, '0');
1212
var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
1313
var yyyy = today.getFullYear();
14+
1415
today = mm + '/' + dd + '/' + yyyy;
1516
document.write(today);
1617
```

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/140 - Can we define properties for functions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ Yes, We can define properties for functions because functions are also objects.
1010
fn = function (x) {
1111
//Function code goes here
1212
};
13+
1314
fn.name = 'John';
15+
1416
fn.profile = function (y) {
1517
//Profile code goes here
1618
};

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/144 - What are js labels.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The label statement allows us to name loops and blocks in JavaScript. We can the
88

99
```javascript
1010
var i, j;
11+
1112
loop1: for (i = 0; i < 3; i++) {
1213
loop2: for (j = 0; j < 3; j++) {
1314
if (i === j) {
@@ -16,6 +17,7 @@ loop1: for (i = 0; i < 3; i++) {
1617
console.log('i = ' + i + ', j = ' + j);
1718
}
1819
}
20+
1921
// Output is:
2022
// "i = 1, j = 0"
2123
// "i = 2, j = 0"

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/15 - What is the currying function.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Let's take an example of n-ary function and how it turns into a currying functio
1111
```javascript
1212
const multiArgFunction = (a, b, c) => a + b + c;
1313
console.log(multiArgFunction(1, 2, 3)); // 6
14+
1415
const curryUnaryFunction = (a) => (b) => (c) => a + b + c;
1516
curryUnaryFunction(1); // returns a function: b => c => 1 + b + c
1617
curryUnaryFunction(1)(2); // returns a function: c => 3 + c

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/16 - What is a pure function.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const impureAddNumber = (number) => numberArray.push(number);
1515
//Pure
1616
const pureAddNumber = (number) => (argNumberArray) =>
1717
argNumberArray.concat([number]);
18+
1819
//Display the results
1920
console.log(impureAddNumber(6)); // returns 1
2021
console.log(numberArray); // returns [6]

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/172 - What are the properties used to get size o.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var width =
1111
window.innerWidth ||
1212
document.documentElement.clientWidth ||
1313
document.body.clientWidth;
14+
1415
var height =
1516
window.innerHeight ||
1617
document.documentElement.clientHeight ||

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/174 - Can you apply chaining on conditional oper.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ function traceValue(someParam) {
1515
: value4
1616
);
1717
}
18+
1819
// The above conditional operator is equivalent to:
20+
1921
function traceValue(someParam) {
2022
if (condition1) {
2123
return value1;

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/177 - Give an example where do you really need s.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var fn = (function () {
1212
//...
1313
})(
1414
// semicolon missing at this line
15+
1516
// then execute some code inside a closure
1617
function () {
1718
//...

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/178 - What is a freeze method.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ The **freeze()** method is used to freeze an object. Freezing an object does not
1010
const obj = {
1111
prop: 100,
1212
};
13+
1314
Object.freeze(obj);
1415
obj.prop = 200; // Throws an error in strict mode
16+
1517
console.log(obj.prop); //100
1618
```
1719

@@ -26,6 +28,7 @@ const user = {
2628
department: 'IT',
2729
},
2830
};
31+
2932
Object.freeze(user);
3033
user.employment.department = 'HR';
3134
```

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/181 - How do you detect a browser language prefe.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var language =
1111
(navigator.languages && navigator.languages[0]) || // Chrome / Firefox
1212
navigator.language || // All browsers
1313
navigator.userLanguage; // IE <= 10
14+
1415
console.log(language);
1516
```
1617

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/185 - What is a rest parameter.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function sum(...args) {
2222
}
2323
return total;
2424
}
25+
2526
console.log(sum(1, 2)); //3
2627
console.log(sum(1, 2, 3)); //6
2728
console.log(sum(1, 2, 3, 4)); //13

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/188 - What is a spread operator.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ Spread operator allows iterables( arrays / objects / strings ) to be expanded in
1010
function calculateSum(x, y, z) {
1111
return x + y + z;
1212
}
13+
1314
const numbers = [1, 2, 3];
15+
1416
console.log(calculateSum(...numbers)); // 6
1517
```
1618

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/192 - How do you copy properties from one object.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ Let's take example with one source and one target object,
1515
```javascript
1616
const target = { a: 1, b: 2 };
1717
const source = { b: 3, c: 4 };
18+
1819
const returnedTarget = Object.assign(target, source);
20+
1921
console.log(target); // { a: 1, b: 3, c: 4 }
22+
2023
console.log(returnedTarget); // { a: 1, b: 3, c: 4 }
2124
```
2225

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/194 - What is a proxy object.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ var handler = {
1818
return prop in obj ? obj[prop] : 100;
1919
},
2020
};
21+
2122
var p = new Proxy({}, handler);
2223
p.a = 10;
2324
p.b = null;
25+
2426
console.log(p.a, p.b); // 10, null
2527
console.log('c' in p, p.c); // false, 100
2628
```

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/198 - How do you determine if an object is seale.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ The Object.isSealed() method is used to determine if an object is sealed or not.
1818
const object = {
1919
property: 'Hello, Good morning',
2020
};
21+
2122
Object.seal(object); // Using seal() method to seal the object
23+
2224
console.log(Object.isSealed(object)); // checking whether the object is sealed or not
2325
```
2426

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/199 - How do you get enumerable key and value pa.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const object = {
1111
a: 'Good morning',
1212
b: 100,
1313
};
14+
1415
for (let [key, value] of Object.entries(object)) {
1516
console.log(`${key}: ${value}`); // a: 'Good morning'
1617
// b: 100

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/20 - How do you redeclare variables in a switch.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ switch (x) {
1212
case 0:
1313
let name;
1414
break;
15+
1516
case 1:
1617
let name; // SyntaxError for redeclaration.
1718
break;

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/200 - What is the main difference between object.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const object = {
1111
a: 'Good morning',
1212
b: 100,
1313
};
14+
1415
for (let value of Object.values(object)) {
1516
console.log(`${value}`); // 'Good morning'
1617
100;

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/201 - How can you get the list of keys of any ob.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const user = {
1212
gender: 'male',
1313
age: 40,
1414
};
15+
1516
console.log(Object.keys(user)); //['name', 'gender', 'age']
1617
```
1718

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/202 - How do you create an object with prototype.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ const user = {
1313
console.log(`My name is ${this.name}.`);
1414
},
1515
};
16+
1617
const admin = Object.create(user);
18+
1719
admin.name = 'Nick'; // Remember that "name" is a property set on "admin" but not on "user" object
20+
1821
admin.printInfo(); // My name is Nick
1922
```
2023

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/214 - What is an anonymous function.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ An anonymous function is a function without a name! Anonymous functions are comm
1010
function (optionalParameters) {
1111
//do something
1212
}
13+
1314
const myFunction = function(){ //Anonymous function assigned to a variable
1415
//do something
1516
};
17+
1618
[1, 2, 3].map(function(element){ //Anonymous function used as a callback function
1719
//do something
1820
});

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/217 - How do you define property on object const.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ The Object.defineProperty() static method is used to define a new property direc
88

99
```javascript
1010
const newObject = {};
11+
1112
Object.defineProperty(newObject, 'newProperty', {
1213
value: 100,
1314
writable: false,
1415
});
16+
1517
console.log(newObject.newProperty); // 100
18+
1619
newObject.newProperty = 200; // It throws an error in strict mode due to writable setting
1720
```
1821

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/220 - Can i add getters and setters using define.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Yes, You can use the `Object.defineProperty()` method to add Getters and Setters
88

99
```javascript
1010
var obj = { counter: 0 };
11+
1112
// Define getters
1213
Object.defineProperty(obj, 'increment', {
1314
get: function () {
@@ -19,6 +20,7 @@ Object.defineProperty(obj, 'decrement', {
1920
this.counter--;
2021
},
2122
});
23+
2224
// Define setters
2325
Object.defineProperty(obj, 'add', {
2426
set: function (value) {
@@ -30,6 +32,7 @@ Object.defineProperty(obj, 'subtract', {
3032
this.counter -= value;
3133
},
3234
});
35+
3336
obj.add = 10;
3437
obj.subtract = 5;
3538
console.log(obj.increment); //6

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/237 - What is call stack.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function hungry() {
1919
function eatFruits() {
2020
return "I'm eating fruits";
2121
}
22+
2223
// Invoke the `hungry` function
2324
hungry();
2425
```

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/239 - What is a decorator.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ function admin(isAdmin) {
1212
target.isAdmin = isAdmin;
1313
}
1414
}
15+
1516
@admin(true)
1617
class User() {
1718
}
1819
console.log(User.isAdmin); //true
20+
1921
@admin(false)
2022
class User() {
2123
}

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/241 - What is an unary operator.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The unary(+) operator is used to convert a variable to a number.If the variable
1010
var x = '100';
1111
var y = +x;
1212
console.log(typeof x, typeof y); // string, number
13+
1314
var a = 'Hello';
1415
var b = +a;
1516
console.log(typeof a, typeof b, b); // string, number, NaN

anki/SJIQ - Javascript interview questions - sudheer jonna/Part I - Introduction/Chapter 1 - Interview Questions/245 - How do you find min and max value in an ar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function findMin(arr) {
1414
function findMax(arr) {
1515
return Math.max.apply(null, arr);
1616
}
17+
1718
console.log(findMin(marks));
1819
console.log(findMax(marks));
1920
```

0 commit comments

Comments
 (0)