From 5b9daa28ae1b8761fab69aba2248300213d603d1 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Wed, 16 Mar 2022 11:11:22 +0530 Subject: [PATCH 001/117] Update README.md --- README.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 9ea5671..e046fc8 100644 --- a/README.md +++ b/README.md @@ -8066,23 +8066,26 @@ c.retrieve(); // => The counter is currently at: 14 ## Q. ***How to divide an array in multiple equal parts in JS?*** ```js -function splitArrayIntoChunksOfLen(arr, len) { - let chunks = [], - i = 0, - n = arr.length; +const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - while (i < n) { - chunks.push(arr.slice(i, (i += len))); +let lenth = 3; + +function split(len) { + while (arr.length > 0) { + let temp = arr.splice(0, len); + console.log(temp); } - return chunks; } -let alphabet = ["a", "b", "c", "d", "e", "f"]; -let alphabetPairs = splitArrayIntoChunksOfLen(alphabet, 2); //split into chunks of two +split(lenth); -console.log(alphabetPairs); +// Output +(3) [1, 2, 3] +(3) [4, 5, 6] +(3) [7, 8, 9] +(1) [10] ``` -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/splitarrayintochunksoflen-5od3rz?file=/src/index.js:0-345)** +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/split-array-5od3rz)**
↥ back to top From 52615bd1d6069cac3393e5c87dfbe8f2b859cd8d Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Wed, 16 Mar 2022 11:13:22 +0530 Subject: [PATCH 002/117] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index e046fc8..6f52914 100644 --- a/README.md +++ b/README.md @@ -8067,13 +8067,11 @@ c.retrieve(); // => The counter is currently at: 14 ```js const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - let lenth = 3; function split(len) { while (arr.length > 0) { - let temp = arr.splice(0, len); - console.log(temp); + console.log(arr.splice(0, len)); } } split(lenth); From 38f1bc20ff8137039a9fc32ac02fed62a640c8c9 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Thu, 17 Mar 2022 07:59:22 +0530 Subject: [PATCH 003/117] Update README.md --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6f52914..6bbe8a8 100644 --- a/README.md +++ b/README.md @@ -18,15 +18,13 @@ function sum(x, y) { }; } } -``` - -Output -```js console.log(sum(2,3)); // Outputs 5 console.log(sum(2)(3)); // Outputs 5 ``` +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-1-ypmjhl?file=/src/index.js)** +
↥ back to top
From b57f69aedae29ef31ab4308412870eb0b5a2e517 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Thu, 17 Mar 2022 08:25:53 +0530 Subject: [PATCH 004/117] Update README.md --- README.md | 88 ++++++++++++++++++++----------------------------------- 1 file changed, 31 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index 6bbe8a8..cabdc86 100644 --- a/README.md +++ b/README.md @@ -34,69 +34,43 @@ console.log(sum(2)(3)); // Outputs 5 ```html - - - Show File Data - - - -
- - -
- + file = input.files[0]; + extension = file.name.substring(file.name.lastIndexOf(".") + 1); + + console.log("File Name: " + file.name); + console.log("File Size: " + file.size + " bytes"); + console.log("File Extension: " + extension); + } + + + + +
+ + +
+ + + + +File Name: pic.jpg +File Size: 1159168 bytes +File Extension: jpg ``` +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-file-upload-fj17kh?file=/index.html)** + From 3ed4e586c2ceef5cacf5ac69e9712d6514f284e9 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Thu, 17 Mar 2022 08:31:41 +0530 Subject: [PATCH 005/117] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cabdc86..1ecd2e4 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ console.log(sum(2)(3)); // Outputs 5 - + Show File Data +

-

- ``` +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-captcha-mzyi2n?file=/index.html)** + From b3494f2041b7e5573540d85629a5fc571e8a2375 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Thu, 17 Mar 2022 11:11:49 +0530 Subject: [PATCH 009/117] Stopwatch --- README.md | 143 +++++++++++++++++++++--------------------------------- 1 file changed, 55 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index ef8bade..acf52ce 100644 --- a/README.md +++ b/README.md @@ -111,107 +111,74 @@ File Extension: jpg Stopwatch Example + -
-

Simple stopwatch made in JavaScript

- - - -
-

- 0 : 00 : - 000 -

-

- In this example Date() methods co-operate with timing function - setInterval(). -

+

Time: 00:00:00



+ + + ``` +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-captcha-mzyi2n?file=/index.html)** + From e3c01946345ad65881a8597966301fe65df2e9c5 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Thu, 17 Mar 2022 11:22:05 +0530 Subject: [PATCH 010/117] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index acf52ce..ae22b42 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,7 @@ File Extension: jpg ``` -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-captcha-mzyi2n?file=/index.html)** +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-stopwatch-j6in1i?file=/index.html)**
↥ back to top From 58dbbde1a7d56c4da1191656feaf16b9bd4704b6 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Thu, 17 Mar 2022 11:34:14 +0530 Subject: [PATCH 011/117] Update README.md --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ae22b42..885bbad 100644 --- a/README.md +++ b/README.md @@ -193,9 +193,13 @@ function reverseString(str) { } return stringRev; } -alert(reverseString("Pradeep")); // Output: peedarP +console.log(reverseString("Hello")); + +// Output: olleH ``` +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-reversestring-sgm1ip?file=/src/index.js)** + @@ -206,8 +210,13 @@ alert(reverseString("Pradeep")); // Output: peedarP function isEmpty(obj) { return Object.keys(obj).length === 0; } + +const obj = {}; +console.log(isEmpty(obj)); // true ``` +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-isempty-b7n04b?file=/src/index.js)** + ## Q. ***JavaScript Regular Expression to validate Email*** ```javascript From 4763103f0d863cf901608e38da3354f4e1cbaed4 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Thu, 17 Mar 2022 11:43:39 +0530 Subject: [PATCH 012/117] Update README.md --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 885bbad..cd94762 100644 --- a/README.md +++ b/README.md @@ -217,12 +217,27 @@ console.log(isEmpty(obj)); // true **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-isempty-b7n04b?file=/src/index.js)** + + ## Q. ***JavaScript Regular Expression to validate Email*** ```javascript -var pattern = /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/; +function validateEmail(email) { + const re = /\S+@\S+\.\S+/; + return re.test(email); +} + +console.log(validateEmail("pradeep.vwa@gmail.com")); // true ``` +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-validateemail-wfopym?file=/src/index.js)** + + + ## Q. ***Use RegEx to test password strength in JavaScript?*** ```javascript From b718d3aa0da8bae2de56b70223c022281518de70 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Thu, 17 Mar 2022 11:48:52 +0530 Subject: [PATCH 013/117] Update README.md --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cd94762..1d1761b 100644 --- a/README.md +++ b/README.md @@ -241,8 +241,8 @@ console.log(validateEmail("pradeep.vwa@gmail.com")); // true ## Q. ***Use RegEx to test password strength in JavaScript?*** ```javascript -var newPassword = "Pq5*@a{J"; -var regularExpression = new RegExp( +let newPassword = "Pq5*@a{J"; +const regularExpression = new RegExp( "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})" ); @@ -250,7 +250,12 @@ if (!regularExpression.test(newPassword)) { alert( "Password should contain atleast one number and one special character !" ); +} else { + console.log("PASS"); } + +// Output +PASS ``` | RegEx | Description | @@ -262,6 +267,8 @@ if (!regularExpression.test(newPassword)) { | (?=.[!@#\$%\^&]) | The string must contain at least one special character, but we are escaping reserved RegEx characters to avoid conflict | | (?=.{8,}) | The string must be eight characters or longer | +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-password-strength-cxl8xy)** + From e618210b079444f6fdb1c68a5d3d753dac405a02 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Thu, 14 Apr 2022 10:59:24 +0530 Subject: [PATCH 014/117] Update README.md --- README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/README.md b/README.md index 1d1761b..dc8d626 100644 --- a/README.md +++ b/README.md @@ -8042,3 +8042,62 @@ split(lenth); + +## Q. ***Write a random integers function to print integers with in a range?*** + +**Example:** + +```js +/** + * function to return a random number + * between min and max range + * + * */ +function randomInteger(min, max) { + return Math.floor(Math.random() * (max - min + 1) ) + min; +} +randomInteger(1, 100); // returns a random integer from 1 to 100 +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-random-integers-yd1cy8?file=/src/index.js)** + + + +## Q. ***How to convert Decimal to Binary in JavaScript?*** + +**Example 01:** Convert Decimal to Binary + +```js +function DecimalToBinary(number) { + let bin = 0; + let rem, + i = 1; + while (number !== 0) { + rem = number % 2; + number = parseInt(number / 2); + bin = bin + rem * i; + i = i * 10; + } + console.log(`Binary: ${bin}`); +} + +DecimalToBinary(10); +``` + +**Example 02:** Convert Decimal to Binary Using `toString()` + +```js +let val = 10; + +console.log(val.toString(2)); // 1010 ==> Binary Conversion +console.log(val.toString(8)); // 12 ==> Octal Conversion +console.log(val.toString(16)); // A ==> Hexadecimal Conversion +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-decimal-to-binary-uhyi8t?file=/src/index.js)** + + From ed357f53dd1741f7e389e67d41674951127d4995 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Fri, 15 Apr 2022 11:57:13 +0530 Subject: [PATCH 015/117] Update README.md --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/README.md b/README.md index dc8d626..d111976 100644 --- a/README.md +++ b/README.md @@ -8101,3 +8101,55 @@ console.log(val.toString(16)); // A ==> Hexadecimal Conversion + +## Q. ***How do you make first letter of the string in an uppercase?*** + +You can create a function which uses chain of string methods such as charAt, toUpperCase and slice methods to generate a string with first letter in uppercase. + +```js +function capitalizeFirstLetter(string) { + let arr = string.split(" "); + for (var i = 0; i < arr.length; i++) { + arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1); + } + return arr.join(" "); +} + +console.log(capitalizeFirstLetter("hello world")); // Hello World +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-capitalizefirstletter-dpjhky?file=/src/index.js)** + + + +## Q. ***Write a function which will test string as a literal and as an object?*** + +The `typeof` operator can be use to test string literal and `instanceof` operator to test String object. + +```js +function check(str) { + if (str instanceof String) { + return "It is an object of string"; + } else { + if (typeof str === "string") { + return "It is a string literal"; + } else { + return "another type"; + } + } +} + +var ltrlStr = "Hi I am string literal"; +var objStr = new String("Hi I am string object"); + +console.log(check(ltrlStr)); // It is a string literal +console.log(check(objStr)); // It is an object of string +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-literal-vs-object-978dqw?file=/src/index.js)** + + From 67160bb5557b29808ca46a56aea0fc1f5ec8d671 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Thu, 28 Apr 2022 16:33:13 +0530 Subject: [PATCH 016/117] Update README.md --- README.md | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/README.md b/README.md index d111976..918c8ba 100644 --- a/README.md +++ b/README.md @@ -8153,3 +8153,76 @@ console.log(check(objStr)); // It is an object of string + +## Q. ***How do you reversing an array?*** + +You can use reverse() method is used reverse the elements in an array. This method is useful to sort an array in descending order. Let us see the usage of reverse() method in an example, + +```js +let numbers = [1, 2, 5, 3, 4]; +numbers.sort((a, b) => b - a); +numbers.reverse(); +console.log(numbers); // [1, 2, 3, 4 ,5] +``` + + + +## Q. ***How do you find min and max value in an array?*** + +You can use `Math.min` and `Math.max` methods on array variable to find the minimum and maximum elements with in an array. +Let us create two functions to find the min and max value with in an array, + +```js +var marks = [50, 20, 70, 60, 45, 30]; +function findMin(arr) { + return Math.min.apply(null, arr); +} +function findMax(arr) { + return Math.max.apply(null, arr); +} + +console.log(findMin(marks)); +console.log(findMax(marks)); +``` + + + +## Q. ***How do you find min and max values without Math functions?*** + +You can write functions which loops through an array comparing each value with the lowest value or highest value to find the min and max values. Let us create those functions to find min an max values, + +```js +var marks = [50, 20, 70, 60, 45, 30]; +function findMin(arr) { + var length = arr.length + var min = Infinity; + while (length--) { + if (arr[length] < min) { + min = arr[length]; + } + } + return min; +} + +function findMax(arr) { + var length = arr.length + var max = -Infinity; + while (length--) { + if (arr[length] > max) { + max = arr[length]; + } + } + return max; +} + +console.log(findMin(marks)); +console.log(findMax(marks)); +``` + + From 43665e9b5c807dc8f4a5b2490b0ce186c7707645 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Tue, 17 May 2022 11:10:36 +0530 Subject: [PATCH 017/117] Update README.md --- README.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/README.md b/README.md index 918c8ba..113a967 100644 --- a/README.md +++ b/README.md @@ -8226,3 +8226,66 @@ console.log(findMax(marks)); + +## Q. ***Write code for merge two JavaScript Object dynamically?*** + +Let say you have two objects + +```js +const person = { + name: "Tanvi", + age: 28 +}; + +const address = { + addressLine1: "Some Location x", + addressLine2: "Some Location y", + city: "Bangalore" +}; +``` + +Write merge function which will take two object and add all the own property of second object into first object. + +```js +merge(person , address); + +/* Now person should have 5 properties +name , age , addressLine1 , addressLine2 , city */ +``` + +**Method 1: Using ES6, Object.assign method:** + +```js +const merge = (toObj, fromObj) => Object.assign(toObj, fromObj); + +console.log(merge(person, address)); +// {name: "Tanvi", age: 28, addressLine1: "Some Location x", addressLine2: "Some Location y", city: "Bangalore"} +``` + +**Method 2: Without using built-in function:** + +```js +function mergeObject(toObj, fromObj) { + // Make sure both of the parameter is an object + if (typeof toObj === "object" && typeof fromObj === "object") { + for (var pro in fromObj) { + // Assign only own properties not inherited properties + if (fromObj.hasOwnProperty(pro)) { + // Assign property and value + toObj[pro] = fromObj[pro]; + } + } + } else { + throw "Merge function can apply only on object"; + } +} + +console.log(mergeObject(person, address)); +// {name: "Tanvi", age: 28, addressLine1: "Some Location x", addressLine2: "Some Location y", city: "Bangalore"} +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-shallow-vs-deep-copy-ik5b7h?file=/src/index.js)** + + From 790ce30326cdc53786b88d386635c588400f491b Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 7 Aug 2022 08:38:12 +0530 Subject: [PATCH 018/117] Update README.md --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 113a967..82b7e98 100644 --- a/README.md +++ b/README.md @@ -8286,6 +8286,27 @@ console.log(mergeObject(person, address)); **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-shallow-vs-deep-copy-ik5b7h?file=/src/index.js)** +## Q. Predict the output + +```js +function find_max(nums) { + let max_num = Number.NEGATIVE_INFINITY; // smaller than all other numbers + for (let num of nums) { + if (num > max_num) { + // (Fill in the missing line here) + } + } + return max_num; +} + +// a.) num = max_num +// b.) max_num += 1 +// c.) max_num = num +// d.) max_num += num +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-code-practice-xjw5n3)** + From aa267892369c65752bea636304a36213e3daf59c Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 7 Aug 2022 08:40:13 +0530 Subject: [PATCH 019/117] Update README.md --- README.md | 496 +++++++++++++++++++++++++++--------------------------- 1 file changed, 248 insertions(+), 248 deletions(-) diff --git a/README.md b/README.md index 82b7e98..0ebc105 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ console.log(sum(2)(3)); // Outputs 5 **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-1-ypmjhl?file=/src/index.js)** ## Q. ***How to validate file size and extension before upload?*** @@ -70,7 +70,7 @@ File Extension: jpg **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-file-upload-fj17kh?file=/index.html)** ## Q. ***Create captcha using javascript?*** @@ -100,7 +100,7 @@ File Extension: jpg **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-captcha-mzyi2n?file=/index.html)** ## Q. ***Create a Stopwatch program in javascript?*** @@ -180,7 +180,7 @@ File Extension: jpg **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-stopwatch-j6in1i?file=/index.html)** ## Q. ***Write a program to reverse a string?*** @@ -201,7 +201,7 @@ console.log(reverseString("Hello")); **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-reversestring-sgm1ip?file=/src/index.js)** ## Q. ***How to check if object is empty or not in javaScript?*** @@ -218,7 +218,7 @@ console.log(isEmpty(obj)); // true **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-isempty-b7n04b?file=/src/index.js)** ## Q. ***JavaScript Regular Expression to validate Email*** @@ -235,7 +235,7 @@ console.log(validateEmail("pradeep.vwa@gmail.com")); // true **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-validateemail-wfopym?file=/src/index.js)** ## Q. ***Use RegEx to test password strength in JavaScript?*** @@ -270,7 +270,7 @@ PASS **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-password-strength-cxl8xy)** ## Q. ***How to compare objects ES6?*** @@ -322,7 +322,7 @@ JSON.stringify(one) === JSON.stringify(two); // false ``` ## Q. ***How to remove array element based on object property?*** @@ -351,7 +351,7 @@ myArray = [ ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -388,7 +388,7 @@ console.log(x); // Output: 10 ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -414,7 +414,7 @@ console.log(1 + -"1" + 2); // Output: 2 ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -429,7 +429,7 @@ getNumber(); // Output: undefined ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -481,7 +481,7 @@ console.log(k); // Output: 1undefined ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -519,7 +519,7 @@ console.log("(a % b): " + (a % b)); // Output: 4 ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -559,7 +559,7 @@ myObject.func(); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -608,7 +608,7 @@ console.log("A" - "B" + 2); // Output: NaN ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -645,7 +645,7 @@ console.log("1 && 2 = " + (1 && 2)); // Output: 2 ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -688,7 +688,7 @@ console.log( ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -727,7 +727,7 @@ obj.method(fn, 1); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -788,7 +788,7 @@ outer(); ``` ## Q. ***Hoisting example in javascript?*** @@ -814,7 +814,7 @@ o.constructor === F; ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -890,7 +890,7 @@ for (var i = 1; i <= 15; i++) { ``` ## Q. ***What will be the output of the following code?*** @@ -921,7 +921,7 @@ console.log(output); The code above will output `1` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **global variable** of type `number`. ## Q. ***What will be the output of the following code?*** @@ -954,7 +954,7 @@ The code above will output `xyz` as output. Here `emp1` object got company as ** `emp1` object doesn't have **company** as its own property. you can test it `console.log(emp1.hasOwnProperty('company')); //output : false` However, we can delete company property directly from `Employee` object using `delete Employee.company` or we can also delete from `emp1` object using `__proto__` property `delete emp1.__proto__.company`. ## Q. ***What will be the output of the following code?*** @@ -989,7 +989,7 @@ The code above will output `1, "truexyz", 2, 1` as output. Here's a general guid - String + String -> Concatenation ## Q. ***What will be the output of the following code?*** @@ -1055,7 +1055,7 @@ var foo = function bar() { ``` ## Q. ***What is the output of the following?*** @@ -1109,7 +1109,7 @@ var salary = "1000$"; ``` ## Q. ***What would be the output of the following code?*** @@ -1142,7 +1142,7 @@ foo["location"] = "USA"; ``` ## Q. ***What would be the output of following code?*** @@ -1158,7 +1158,7 @@ The output will `'hi there'` because we're dealing with strings here. Strings ar passed by value, that is, copied. ## Q. ***What would be the output of following code?*** @@ -1191,7 +1191,7 @@ However, when we reassign `objB` to an empty object, we simply change where `obj This doesn't affect where `objA` variable references to. ## Q. ***What would be the output of following code?*** @@ -1224,7 +1224,7 @@ The `slice` function copies all the elements of the array returning the new arra `arrA` and `arrB` reference two completely different arrays. ## Q. ***What would be the output of following code?*** @@ -1288,7 +1288,7 @@ two elements. This is why changing the property of `arrB[0]` in `arrB` will also change the `arrA[0]`. ## Q. ***console.log(employeeId);*** @@ -1332,7 +1332,7 @@ var employeeId = "1234abe"; _Answer:_ 2) undefined ## Q. ***What would be the output of following code?*** @@ -1374,7 +1374,7 @@ _Answer:_ 2) undefined _Answer:_ 1) undefined ## Q. ***What would be the output of following code?*** @@ -1419,7 +1419,7 @@ console.log(employeeId); _Answer:_ 3) 'abc123' ## Q. ***What would be the output of following code?*** @@ -1468,7 +1468,7 @@ foo(); _Answer:_ 1) undefined ## Q. ***What would be the output of following code?*** @@ -1496,7 +1496,7 @@ _Answer:_ 1) undefined _Answer:_ 3) function function ## Q. ***What would be the output of following code?*** @@ -1528,7 +1528,7 @@ _Answer:_ 3) function function _Answer:_ 3) ["name", "salary", "country", "phoneNo"] ## Q. ***What would be the output of following code?*** @@ -1560,7 +1560,7 @@ _Answer:_ 3) ["name", "salary", "country", "phoneNo"] _Answer:_ 4) ["name", "salary", "country"] ## Q. ***What would be the output of following code?*** @@ -1606,7 +1606,7 @@ _Answer:_ 2) false false _Answer:_ 2) false false ## Q. ***What would be the output of following code?*** @@ -1652,7 +1652,7 @@ _Answer:_ 2) false false _Answer:_ 2) false false ## Q. ***What would be the output of following code?*** @@ -1698,7 +1698,7 @@ _Answer:_ 4) true true _Answer:_ 3) true true true true ## Q. ***What would be the output of following code?*** @@ -1746,7 +1746,7 @@ _Answer:_ 2) bar bar _Answer:_ 3) foo foo ## Q. ***What would be the output of following code?*** @@ -1790,7 +1790,7 @@ _Answer:_ 2) undefined undefined _Answer:_ 3) ["100"] 1 ## Q. ***What would be the output of following code?*** @@ -1833,7 +1833,7 @@ _Answer:_ 1) [] [] [Array[5]] 1 _Answer:_ 1) 11 ## Q. ***What would be the output of following code?*** @@ -1873,7 +1873,7 @@ _Answer:_ 3) 6 _Answer:_ 1) [ 'dog', 'rat', 'goat', 'cow', 'horse', 'cat' ] ## Q. ***What would be the output of following code?*** @@ -1914,7 +1914,7 @@ _Answer:_ 1) 1 -1 -1 4 _Answer:_ 2) 1 6 -1 ## Q. ***What would be the output of following code?*** @@ -1981,7 +1981,7 @@ _Answer:_ 1) [ 2, '12', true ] [ 2, '12', true ] ## Q. ***What would be the output of following code?*** @@ -2043,7 +2043,7 @@ _Answer:_ 1) [ 'bar', 'john', 'ritz' ] _Answer:_ 1. [ 'bar', 'john' ] [] [ 'foo' ] ## Q. ***What would be the output of following code?*** @@ -2089,7 +2089,7 @@ console.log(funcA()); _Answer:_ 1) ## Q. ***What would be the output of following code?*** @@ -2133,7 +2133,7 @@ console.log(obj.innerMessage()); _Answer:_ 1) Hello ## Q. ***What would be the output of following code?*** @@ -2180,7 +2180,7 @@ console.log(obj.innerMessage()); _Answer:_ 2) 'Hello' ## Q. ***What would be the output of following code?*** @@ -2220,7 +2220,7 @@ console.log(myFunc()); _Answer:_ 2) 'Hi John' ## Q. ***What would be the output of following code?*** @@ -2259,7 +2259,7 @@ console.log(myFunc("a", "b", "c", "d")); _Answer:_ a) 2 2 2 ## Q. ***What would be the output of following code?*** @@ -2309,7 +2309,7 @@ Person.displayName(); _Answer:_ 1) John Person ## Q. ***What would be the output of following code?*** @@ -2353,7 +2353,7 @@ console.log(Employee.employeeId); _Answer:_ 4) undefined ## Q. ***What would be the output of following code?*** @@ -2400,7 +2400,7 @@ var employeeId = "aq123"; _Answer:_ 1) foo123 aq123 ## Q. ***What would be the output of following code?*** @@ -2454,7 +2454,7 @@ _Answer:_ 4) [ 'W', 'o', 'r', 'l', 'd' ] _Answer:_ 1) Total amount left in account: 5600 Total amount left in account: 5300 ## Q. ***What would be the output of following code?*** @@ -2490,7 +2490,7 @@ _Answer:_ 1) Total amount left in account: 5600 Total amount left in account: 53 _Answer:_ 1) 5600 5300 5100 ## Q. ***What would be the output of following code?*** @@ -2526,7 +2526,7 @@ _Answer:_ 1) 5600 5300 5100 _Answer:_ 2) 3600 3300 3100 ## Q. ***What would be the output of following code?*** @@ -2571,7 +2571,7 @@ getDataFromServer("www.google.com").then(function (name) { _Answer:_ 1) John ## Q. ***What would be the output of following code?*** @@ -2621,7 +2621,7 @@ _Answer:_ 1) [ 2, 8, 15, 16, 23, 42 ] [ 2, 8, 15, 16, 23, 42 ] ## Q. ***What would be the output of following code?*** @@ -2665,7 +2665,7 @@ console.log(numb); _Answer:_ 1) 5 ## Q. ***What would be the output of following code?*** @@ -2712,7 +2712,7 @@ console.log(mul(2)(3)[1](4)); _Answer:_ 1) 6, 10 ## Q. ***What would be the output of following code?*** @@ -2764,7 +2764,7 @@ console.log(mul(2)(3)(4)(5)(6)); _Answer:_ 1) 720 ## Q. ***What is the value of `foo`?*** @@ -2808,7 +2808,7 @@ add()()(2)(5); // 7 ``` ## Q. ***What value is returned from the following statement?*** @@ -2844,7 +2844,7 @@ _Answer:_ - Second: Throws an exception, `ReferenceError: bar is not defined` ## Q. ***What is the value of `foo.length`?*** @@ -2874,7 +2874,7 @@ to an original object, `{n: 1}`. So, when the result of the right term, `{n: 2}` moment referenced by `bar`. ## Q. ***What does the following code print?*** @@ -2915,7 +2915,7 @@ console.log(countCharacters("the brown fox jumps over the lazy dog")); ``` ## Q. ***What is the value of `foo`?*** @@ -2959,7 +2959,7 @@ add()()(2)(5); // 7 ``` ## Q. ***What value is returned from the following statement?*** @@ -3005,7 +3005,7 @@ foo.push(2); _Answer:_ `.push` is mutable - `2` ## Q. ***What is the value of `foo.x`?*** @@ -3025,7 +3025,7 @@ to an original object, `{n: 1}`. So, when the result of the right term, `{n: 2}` moment referenced by `bar`. ## Q. ***What does the following code print?*** @@ -3075,7 +3075,7 @@ f = g = 0; ``` ## Q. ***What will be the output?*** @@ -3150,7 +3150,7 @@ try { ``` ## Q. ***What will the following code output?*** @@ -3187,7 +3187,7 @@ console.log(emp1.company); ``` ## Q. ***Make this work: @@ -3205,7 +3205,7 @@ duplicate([1, 2, 3, 4, 5]); // [1,2,3,4,5,1,2,3,4,5] ``` ## Q. ***Fix the bug using ES5 only?*** @@ -3238,7 +3238,7 @@ for (var i = 0; i < arr.length; i++) { ``` ## Q. ***What will be the output of the following code?*** @@ -3269,7 +3269,7 @@ console.log(result); // 200
4
40
``` ## Q. ***What will be the output of the following code?*** @@ -3306,7 +3306,7 @@ console.log([...country]); ``` ## Q. ***Given and object and property path. Get value from property path*** @@ -3342,7 +3342,7 @@ path = "system.database.1.port"; ``` ## Q. ***How to filter object from Arrays of Objects*** @@ -3360,7 +3360,7 @@ str = str.replace(/test/g, ""); ``` ## Q. ***Write a script that returns the number of occurrences of character given a string as input*** @@ -3384,7 +3384,7 @@ console.log(countCharacters("the brown fox jumps over the lazy dog")); ``` ## Q. ***write a script that return the number of occurrences of a character in paragraph*** @@ -3406,7 +3406,7 @@ console.log(charCount("the brown fox jumps over the lazy dog", "o")); ``` ## Q. ***Recursive and non-recursive Factorial function*** @@ -3443,7 +3443,7 @@ console.log(factorial(5)); ``` ## Q. ***Recursive and non recursive fibonacci-sequence*** @@ -3501,7 +3501,7 @@ console.log(min + Math.floor(Math.random() * (max - min + 1))); ``` ## Q. ***Get HTML form values as JSON object*** @@ -3526,7 +3526,7 @@ document.querySelector("HTML_FORM_CLASS").elements; ``` ## Q. ***Reverse the number*** @@ -3546,7 +3546,7 @@ console.log(reverse(12345)); ``` ## Q. ***Remove Duplicate elements from Array*** @@ -3582,7 +3582,7 @@ console.log([...new Set(arr)]); ``` ## Q. ***Deep copy of object or clone of object*** @@ -3621,7 +3621,7 @@ console.log(deepExtend({}, { a: 1, b: { c: 2, d: 3 } }, { e: 4, b: { f: 1 } })); ``` ## Q. ***Sort ticket based on flying order.*** @@ -3672,7 +3672,7 @@ new SortTickets({ ``` ## Q. ***Cuncurrent execute function based on input number*** @@ -3722,7 +3722,7 @@ c.start(); ``` ## Q. ***Reversing an array*** @@ -3782,7 +3782,7 @@ console.log(topN([1, 8, 3, 4, 5], 2)); // [5,8] ``` ## Q. ***Get query params from Object*** @@ -3811,7 +3811,7 @@ console.log( ``` ## Q. ***Consecutive 1's in binary*** @@ -3838,7 +3838,7 @@ console.log(consecutiveOne(5)); //1 ``` ## Q. ***Spiral travesal of matrix*** @@ -3885,7 +3885,7 @@ console.log(spiralTraversal(input)); // [1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5 ``` ## Q. ***Merge Sorted array and sort it.*** @@ -3899,7 +3899,7 @@ console.log(mergeSortedArray([1, 2, 3, 4, 5, 6], [0, 3, 4, 7])); // [0, 1, 2, 3, ``` ## Q. ***Anagram of words*** @@ -3931,7 +3931,7 @@ console.log( ``` ## Q. ***Print the largest (maximum) hourglass sum found in 2d array.*** @@ -3961,7 +3961,7 @@ function main(arr) { ``` ## Q. ***Transform array of object to array*** @@ -3995,7 +3995,7 @@ console.log(Object.keys(newData).map((key) => newData[key])); ``` ## Q. ***Create a private variable or private method in object*** @@ -4020,7 +4020,7 @@ obj.callPrivateFunction(); // this is private function ``` ## Q. ***Flatten only Array not objects*** @@ -4075,7 +4075,7 @@ console.log(flattenIterative1(list2)); // [0, 1, 2, 3, 4, 5] ``` ## Q. ***Find max difference between two number in Array*** @@ -4105,7 +4105,7 @@ let a = 10, ``` ## Q. ***Panagram ? it means all the 26 letters of alphabet are there*** @@ -4135,7 +4135,7 @@ processData("We promptly judged antique ivory buckles for the prize"); // Not Pa ``` ## Q. ***Given two identical DOM trees (not the same one), and a node from one of them find the node in the other one.*** @@ -4170,7 +4170,7 @@ console.log(locateNodeFromPath(rootB, getPath(rootA, target))); ``` ## Q. ***Convert a number into a Roman Numeral*** @@ -4206,7 +4206,7 @@ console.log(romanize(3)); // III ``` ## Q. ***check if parenthesis is malformed or not*** @@ -4238,7 +4238,7 @@ console.log(matchParenthesis("}{{}}"), matchParenthesis("{{[]}}")); // false - t ``` ## Q. ***Create Custom Event Emitter class*** @@ -4276,7 +4276,7 @@ e.emit("callme", ["a", "b"], { firstName: "umesh", lastName: "gohil" }); ``` ## Q. ***Max value from an array*** @@ -4289,7 +4289,7 @@ Math.max.apply(Math, arr); // Slow ``` ## Q. ***DOM methods*** @@ -4328,7 +4328,7 @@ el.style // get the style of el ``` ## Q. ***search function called after 500 ms*** @@ -4351,7 +4351,7 @@ search.addEventListener("keyup", function () { ``` ## Q. ***Move all zero's to end*** @@ -4373,7 +4373,7 @@ console.log(moveZeroToEnd([1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0])); // [1, 8, 2, 3, 4 ``` ## Q. ***Decode message in matrix [diagional down right, diagional up right]*** @@ -4422,7 +4422,7 @@ console.log(decodeMessage(mat)); //IROELEA ``` ## Q. ***find a pair in array, whose sum is equal to given number.*** @@ -4473,7 +4473,7 @@ console.log(hasPairSum([6, 4, 3, 8], 8)); ``` ## Q. ***Binary Search [Array should be sorted]*** @@ -4501,7 +4501,7 @@ console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 27)); ``` ## Q. ***Pascal triangle.*** @@ -4523,7 +4523,7 @@ console.log(pascalTriangle(2)); ``` ## Q. ***Explain the code below. How many times the createVal function is called?*** @@ -4551,7 +4551,7 @@ VM298:6 5 ``` ## Q. ***What is the output?*** @@ -4579,7 +4579,7 @@ Within the function, we first declare the `name` variable with the `var` keyword Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don't get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`. ## Q. ***What is the output?*** @@ -4605,7 +4605,7 @@ Because of the event queue in JavaScript, the `setTimeout` callback function is In the second loop, the variable `i` was declared using the `let` keyword: variables declared with the `let` (and `const`) keyword are block-scoped (a block is anything between `{ }`). During each iteration, `i` will have a new value, and each value is scoped inside the loop. ## Q. ***What is the output?*** @@ -4637,7 +4637,7 @@ With arrow functions, the `this` keyword refers to its current surrounding scope There is no value `radius` on that object, which returns `undefined`. ## Q. ***What is the output?*** @@ -4658,7 +4658,7 @@ The unary plus tries to convert an operand to a number. `true` is `1`, and `fals The string `'Lydia'` is a truthy value. What we're actually asking, is "is this truthy value falsy?". This returns `false`. ## Q. ***Which one is true?*** @@ -4690,7 +4690,7 @@ JavaScript interprets (or unboxes) statements. When we use bracket notation, it However, with dot notation, this doesn't happen. `mouse` does not have a key called `bird`, which means that `mouse.bird` is `undefined`. Then, we ask for the `size` using dot notation: `mouse.bird.size`. Since `mouse.bird` is `undefined`, we're actually asking `undefined.size`. This isn't valid, and will throw an error similar to `Cannot read property "size" of undefined`. ## Q. ***What is the output?*** @@ -4721,7 +4721,7 @@ First, variable `c` holds a value to an object. Later, we assign `d` with the sa When you change one object, you change all of them. ## Q. ***What is the output?*** @@ -4750,7 +4750,7 @@ When we use the `==` operator, it only checks whether it has the same _value_. T However, when we use the `===` operator, both value _and_ type should be the same. It's not: `new Number()` is not a number, it's an **object**. Both return `false.` ## Q. ***What is the output?*** @@ -4781,7 +4781,7 @@ console.log(freddie.colorChange("orange")); The `colorChange` function is static. Static methods are designed to live only on the constructor in which they are created, and cannot be passed down to any children. Since `freddie` is a child, the function is not passed down, and not available on the `freddie` instance: a `TypeError` is thrown. ## Q. ***What is the output?*** @@ -4803,7 +4803,7 @@ It logs the object, because we just created an empty object on the global object In order to avoid this, we can use `"use strict"`. This makes sure that you have declared a variable before setting it equal to anything. ## Q. ***What happens when we do this?*** @@ -4828,7 +4828,7 @@ This is possible in JavaScript, because functions are objects! (Everything besid A function is a special type of object. The code you write yourself isn't the actual function. The function is an object with properties. This property is invocable. ## Q. ***What is the output?*** @@ -4865,7 +4865,7 @@ Person.prototype.getFullName = function () { would have made `member.getFullName()` work. Why is this beneficial? Say that we added this method to the constructor itself. Maybe not every `Person` instance needed this method. This would waste a lot of memory space, since they would still have that property, which takes of memory space for each instance. Instead, if we only add it to the prototype, we just have it at one spot in memory, yet they all have access to it! ## Q. ***What is the output?*** @@ -4895,7 +4895,7 @@ For `sarah`, we didn't use the `new` keyword. When using `new`, it refers to the We said that `this.firstName` equals `"Sarah"` and `this.lastName` equals `"Smith"`. What we actually did, is defining `global.firstName = 'Sarah'` and `global.lastName = 'Smith'`. `sarah` itself is left `undefined`, since we don't return a value from the `Person` function. ## Q. ***What are the three phases of event propagation?*** @@ -4912,7 +4912,7 @@ During the **capturing** phase, the event goes through the ancestor elements dow ## Q. ***All object have prototypes.*** @@ -4925,7 +4925,7 @@ During the **capturing** phase, the event goes through the ancestor elements dow All objects have prototypes, except for the **base object**. The base object is the object created by the user, or an object that is created using the `new` keyword. The base object has access to some methods and properties, such as `.toString`. This is the reason why you can use built-in JavaScript methods! All of such methods are available on the prototype. Although JavaScript can't find it directly on your object, it goes down the prototype chain and finds it there, which makes it accessible for you. ## Q. ***What is the output?*** @@ -4950,7 +4950,7 @@ JavaScript is a **dynamically typed language**: we don't specify what types cert In this example, JavaScript converts the number `1` into a string, in order for the function to make sense and return a value. During the addition of a numeric type (`1`) and a string type (`'2'`), the number is treated as a string. We can concatenate strings like `"Hello" + "World"`, so What is happening here is `"1" + "2"` which returns `"12"`. ## Q. ***What is the output?*** @@ -4982,7 +4982,7 @@ The **prefix** unary operator `++`: This returns `0 2 2`. ## Q. ***What is the output?*** @@ -5009,7 +5009,7 @@ getPersonInfo`${person} is ${age} years old`; If you use tagged template literals, the value of the first argument is always an array of the string values. The remaining arguments get the values of the passed expressions! ## Q. ***What is the output?*** @@ -5041,7 +5041,7 @@ The two objects that we are comparing don't have that: the object we passed as a This is why both `{ age: 18 } === { age: 18 }` and `{ age: 18 } == { age: 18 }` return `false`. ## Q. ***What is the output?*** @@ -5064,7 +5064,7 @@ getAge(21); The rest parameter (`...args`.) lets us "collect" all remaining arguments into an array. An array is an object, so `typeof args` returns `"object"` ## Q. ***What is the output?*** @@ -5089,7 +5089,7 @@ getAge(); With `"use strict"`, you can make sure that you don't accidentally declare global variables. We never declared the variable `age`, and since we use `"use strict"`, it will throw a reference error. If we didn't use `"use strict"`, it would have worked, since the property `age` would have gotten added to the global object. ## Q. ***What is value of `sum`?*** @@ -5108,7 +5108,7 @@ const sum = eval("10*10+5"); `eval` evaluates codes that's passed as a string. If it's an expression, like in this case, it evaluates the expression. The expression is `10 * 10 + 5`. This returns the number `105`. ## Q. ***How long is cool_secret accessible?*** @@ -5129,7 +5129,7 @@ The data stored in `sessionStorage` is removed after closing the _tab_. If you used `localStorage`, the data would've been there forever, unless for example `localStorage.clear()` is invoked. ## Q. ***What is the output?*** @@ -5152,7 +5152,7 @@ With the `var` keyword, you can declare multiple variables with the same name. T You cannot do this with `let` or `const` since they're block-scoped. ## Q. ***What is the output?*** @@ -5179,7 +5179,7 @@ All object keys (excluding Symbols) are strings under the hood, even if you don' It doesn't work that way for a set. There is no `'1'` in our set: `set.has('1')` returns `false`. It has the numeric type `1`, `set.has(1)` returns `true`. ## Q. ***What is the output?*** @@ -5199,7 +5199,7 @@ console.log(obj); If you have two keys with the same name, the key will be replaced. It will still be in its first position, but with the last specified value. ## Q. ***The JavaScript global execution context creates two things for you: the global object, and the "this" keyword.*** @@ -5213,7 +5213,7 @@ If you have two keys with the same name, the key will be replaced. It will still The base execution context is the global execution context: it's What is accessible everywhere in your code. ## Q. ***What is the output?*** @@ -5235,7 +5235,7 @@ for (let i = 1; i < 5; i++) { The `continue` statement skips an iteration if a certain condition returns `true`. ## Q. ***What is the output?*** @@ -5260,7 +5260,7 @@ name.giveLydiaPizza(); `String` is a built-in constructor, which we can add properties to. I just added a method to its prototype. Primitive strings are automatically converted into a string object, generated by the string prototype function. So, all strings (string objects) have access to that method! ## Q. ***What is the output?*** @@ -5290,7 +5290,7 @@ However, when we stringify an object, it becomes `"[Object object]"`. So what we Then, we log `a[b]`, which is actually `a["Object object"]`. We just set that to `456`, so it returns `456`. ## Q. ***What is the output?*** @@ -5339,7 +5339,7 @@ This is where an event loop starts to work. An **event loop** looks at the stack `bar` gets invoked, `"Second"` gets logged, and it's popped off the stack. ## Q. ***What is the event.target when clicking the button?*** @@ -5362,7 +5362,7 @@ This is where an event loop starts to work. An **event loop** looks at the stack The deepest nested element that caused the event is the target of the event. You can stop bubbling by `event.stopPropagation` ## Q. ***When you click the paragraph, What is the logged output?*** @@ -5383,7 +5383,7 @@ The deepest nested element that caused the event is the target of the event. You If we click `p`, we see two logs: `p` and `div`. During event propagation, there are 3 phases: capturing, target, and bubbling. By default, event handlers are executed in the bubbling phase (unless you set `useCapture` to `true`). It goes from the deepest nested element outwards. ## Q. ***What is the output?*** @@ -5411,7 +5411,7 @@ With both, we can pass the object to which we want the `this` keyword to refer t `.bind.` returns a _copy_ of the function, but with a bound context! It is not executed immediately. ## Q. ***What is the output?*** @@ -5436,7 +5436,7 @@ The `sayHi` function returns the returned value of the immediately invoked funct FYI: there are only 7 built-in types: `null`, `undefined`, `boolean`, `number`, `string`, `object`, and `symbol`. `"function"` is not a type, since functions are objects, it's of type `"object"`. ## Q. ***Which of these values are falsy?*** @@ -5469,7 +5469,7 @@ There are only six falsy values: Function constructors, like `new Number` and `new Boolean` are truthy. ## Q. ***What is the output?*** @@ -5489,7 +5489,7 @@ console.log(typeof typeof 1); `typeof "number"` returns `"string"` ## Q. ***What is the output?*** @@ -5514,7 +5514,7 @@ When you set a value to an element in an array that exceeds the length of the ar depending on where you run it (it's different for every browser, node, etc.) ## Q. ***What is the output?*** @@ -5547,7 +5547,7 @@ Later, we set this block-scoped variable equal to `1`, and set the value of the Outside of the `catch` block, `x` is still `undefined`, and `y` is `2`. When we want to `console.log(x)` outside of the `catch` block, it returns `undefined`, and `y` returns `2`. ## Q. ***Everything in JavaScript is either a...*** @@ -5566,7 +5566,7 @@ Primitive types are `boolean`, `null`, `undefined`, `bigint`, `number`, `string` What differentiates a primitive from an object is that primitives do not have any properties or methods; however, you'll note that `'foo'.toUpperCase()` evaluates to `'FOO'` and does not result in a `TypeError`. This is because when you try to access a property or method on a primitive like a string, JavaScript will implicitly wrap the object using one of the wrapper classes, i.e. `String`, and then immediately discard the wrapper after the expression evaluates. All primitives except for `null` and `undefined` exhibit this behaviour. ## Q. ***What is the output?*** @@ -5595,7 +5595,7 @@ What differentiates a primitive from an object is that primitives do not have an Then, `[1, 2, 0, 1]` is `acc` and `[2, 3]` is `cur`. We concatenate them, and get `[1, 2, 0, 1, 2, 3]` ## Q. ***What is the output?*** @@ -5620,7 +5620,7 @@ Then, `[1, 2, 0, 1]` is `acc` and `[2, 3]` is `cur`. We concatenate them, and ge `1` is truthy. `!1` returns `false`. `!false` returns `true`. ## Q. ***What does the `setInterval` method return in the browser?*** @@ -5639,7 +5639,7 @@ setInterval(() => console.log("Hi"), 1000); It returns a unique id. This id can be used to clear that interval with the `clearInterval()` function. ## Q. ***What does this return?*** @@ -5658,7 +5658,7 @@ It returns a unique id. This id can be used to clear that interval with the `cle A string is an iterable. The spread operator maps every character of an iterable to one element. ## Q. ***What is the output?*** @@ -5689,7 +5689,7 @@ First, we initialize the generator function with `i` equal to `10`. We invoke th Then, we invoke the function again with the `next()` method. It starts to continue where it stopped previously, still with `i` equal to `10`. Now, it encounters the next `yield` keyword, and yields `i * 2`. `i` is equal to `10`, so it returns `10 * 2`, which is `20`. This results in `10, 20`. ## Q. ***What does this return?*** @@ -5716,7 +5716,7 @@ Promise.race([firstPromise, secondPromise]).then((res) => console.log(res)); When we pass multiple promises to the `Promise.race` method, it resolves/rejects the _first_ promise that resolves/rejects. To the `setTimeout` method, we pass a timer: 500ms for the first promise (`firstPromise`), and 100ms for the second promise (`secondPromise`). This means that the `secondPromise` resolves first with the value of `'two'`. `res` now holds the value of `'two'`, which gets logged. ## Q. ***What is the output?*** @@ -5751,7 +5751,7 @@ Then, we set the variable `person` equal to `null`. We are only modifying the value of the `person` variable, and not the first element in the array, since that element has a different (copied) reference to the object. The first element in `members` still holds its reference to the original object. When we log the `members` array, the first element still holds the value of the object, which gets logged. ## Q. ***What is the output?*** @@ -5777,7 +5777,7 @@ for (const item in person) { With a `for-in` loop, we can iterate through object keys, in this case `name` and `age`. Under the hood, object keys are strings (if they're not a Symbol). On every loop, we set the value of `item` equal to the current key it’s iterating over. First, `item` is equal to `name`, and gets logged. Then, `item` is equal to `age`, which gets logged. ## Q. ***What is the output?*** @@ -5800,7 +5800,7 @@ Operator associativity is the order in which the compiler evaluates the expressi `7 + '5'` results in `"75"` because of coercion. JavaScript converts the number `7` into a string, see question 15. We can concatenate two strings using the `+`operator. `"7" + "5"` results in `"75"`. ## Q. ***What is the value of `num`?*** @@ -5821,7 +5821,7 @@ Only the first numbers in the string is returned. Based on the _radix_ (the seco `*` is not a valid number. It only parses `"7"` into the decimal `7`. `num` now holds the value of `7`. ## Q. ***What is the output`?*** @@ -5845,7 +5845,7 @@ When mapping over the array, the value of `num` is equal to the element it’s c However, we don’t return a value. When we don’t return a value from the function, the function returns `undefined`. For every element in the array, the function block gets called, so for each element we return `undefined`. ## Q. ***What is the output?*** @@ -5878,7 +5878,7 @@ The variable `birthYear` has a reference to the value `"1997"`. The argument `ye The value of `person` is an object. The argument `member` has a (copied) reference to the _same_ object. When we modify a property of the object `member` has a reference to, the value of `person` will also be modified, since they both have a reference to the same object. `person`'s `name` property is now equal to the value `"Lydia"` ## Q. ***What is the output?*** @@ -5912,7 +5912,7 @@ With the `throw` statement, we can create custom errors. With this statement, yo With the `catch` statement, we can specify what to do if an exception is thrown in the `try` block. An exception is thrown: the string `'Hello world'`. `e` is now equal to that string, which we log. This results in `'Oh an error: Hello world'`. ## Q. ***What is the output?*** @@ -5937,7 +5937,7 @@ console.log(myCar.make); When you return a property, the value of the property is equal to the _returned_ value, not the value set in the constructor function. We return the string `"Maserati"`, so `myCar.make` is equal to `"Maserati"`. ## Q. ***What is the output?*** @@ -5972,7 +5972,7 @@ Then, we declare a variable `x` with the value of `y`, which is `10`. Variables However, we created a global variable `y` when setting `y` equal to `10`. This value is accessible anywhere in our code. `y` is defined, and holds a value of type `"number"`. `console.log(typeof y)` returns `"number"`. ## Q. ***What is the output?*** @@ -6009,7 +6009,7 @@ We can delete properties from objects using the `delete` keyword, also on the pr When we try to invoke something that is not a function, a `TypeError` is thrown. In this case `TypeError: pet.bark is not a function`, since `pet.bark` is `undefined`. ## Q. ***What is the output?*** @@ -6032,7 +6032,7 @@ The `Set` object is a collection of _unique_ values: a value can only occur once We passed the iterable `[1, 1, 2, 3, 4]` with a duplicate value `1`. Since we cannot have two of the same values in a set, one of them is removed. This results in `{1, 2, 3, 4}`. ## Q. ***What is the output?*** @@ -6064,7 +6064,7 @@ An imported module is _read-only_: you cannot modify the imported module. Only t When we try to increment the value of `myCounter`, it throws an error: `myCounter` is read-only and cannot be modified. ## Q. ***What is the output?*** @@ -6089,7 +6089,7 @@ The `delete` operator returns a boolean value: `true` on a successful deletion, The `name` variable was declared with a `const` keyword, so its deletion is not successful: `false` is returned. When we set `age` equal to `21`, we actually added a property called `age` to the global object. You can successfully delete properties from objects this way, also the global object, so `delete age` returns `true`. ## Q. ***What is the output?*** @@ -6127,7 +6127,7 @@ The value of `a` is now `1`, and the value of `b` is now `2`. What we actually d This means that the value of `y` is equal to the first value in the array, which is the number `1`. When we log `y`, `1` is returned. ## Q. ***What is the output?*** @@ -6149,7 +6149,7 @@ console.log(admin); It's possible to combine objects using the spread operator `...`. It lets you create copies of the key/value pairs of one object, and add them to another object. In this case, we create copies of the `user` object, and add them to the `admin` object. The `admin` object now contains the copied key/value pairs, which results in `{ admin: true, name: "Lydia", age: 21 }`. ## Q. ***What is the output?*** @@ -6175,7 +6175,7 @@ With the `defineProperty` method, we can add new properties to an object, or mod Properties added using the `defineProperty` method are immutable by default. You can override this behavior using the `writable`, `configurable` and `enumerable` properties. This way, the `defineProperty` method gives you a lot more control over the properties you're adding to an object. ## Q. ***What is the output?*** @@ -6205,7 +6205,7 @@ If the replacer is an _array_, only the property names included in the array wil If the replacer is a _function_, this function gets called on every property in the object you're stringifying. The value returned from this function will be the value of the property when it's added to the JSON string. If the value is `undefined`, this property is excluded from the JSON string. ## Q. ***What is the output?*** @@ -6235,7 +6235,7 @@ The unary operator `++` _first returns_ the value of the operand, _then incremen `num2` is `10`, since we passed `num1` to the `increasePassedNumber`. `number` is equal to `10`(the value of `num1`. Again, the unary operator `++` _first returns_ the value of the operand, _then increments_ the value of the operand. The value of `number` is `10`, so `num2` is equal to `10`. ## Q. ***What is the output?*** @@ -6269,7 +6269,7 @@ The third time we invoke multiply, we do pass an argument: the object called `va The fourth time, we pass the `value` object again. `x.number` was previously modified to `20`, so `x.number *= 2` logs `40`. ## Q. ***What is the output?*** @@ -6302,7 +6302,7 @@ On the fourth call, we again don't return from the callback function. The accumu --- ## Q. ***With which constructor can we successfully extend the `Dog` class?*** @@ -6351,7 +6351,7 @@ With the `super` keyword, we call that parent class's constructor with the given The `Labrador` class receives two arguments, `name` since it extends `Dog`, and `size` as an extra property on the `Labrador` class. They both need to be passed to the constructor function on `Labrador`, which is done correctly using constructor 2. ## Q. ***What is the output?*** @@ -6379,7 +6379,7 @@ With the `import` keyword, all imported modules are _pre-parsed_. This means tha This is a difference between `require()` in CommonJS and `import`! With `require()`, you can load dependencies on demand while the code is being run. If we would have used `require` instead of `import`, `running index.js`, `running sum.js`, `3` would have been logged to the console. ## Q. ***What is the output?*** @@ -6400,7 +6400,7 @@ console.log(Symbol("foo") === Symbol("foo")); Every Symbol is entirely unique. The purpose of the argument passed to the Symbol is to give the Symbol a description. The value of the Symbol is not dependent on the passed argument. As we test equality, we are creating two entirely new symbols: the first `Symbol('foo')`, and the second `Symbol('foo')`. These two values are unique and not equal to each other, `Symbol('foo') === Symbol('foo')` returns `false`. ## Q. ***What is the output?*** @@ -6423,7 +6423,7 @@ With the `padStart` method, we can add padding to the beginning of a string. The If the argument passed to the `padStart` method is smaller than the length of the array, no padding will be added. ## Q. ***What is the output?*** @@ -6442,7 +6442,7 @@ console.log("🥑" + "💻"); With the `+` operator, you can concatenate strings. In this case, we are concatenating the string `"🥑"` with the string `"💻"`, resulting in `"🥑💻"`. ## Q. ***How can we log the values that are commented out after the console.log statement?*** @@ -6475,7 +6475,7 @@ Every line is executed, until it finds the first `yield` keyword. There is a `yi When we call `game.next("Yes").value`, the previous `yield` is replaced with the value of the parameters passed to the `next()` function, `"Yes"` in this case. The value of the variable `answer` is now equal to `"Yes"`. The condition of the if-statement returns `false`, and `JavaScript loves you back ❤️` gets logged. ## Q. ***What is the output?*** @@ -6506,7 +6506,7 @@ With `String.raw`, it would simply ignore the escape and print: In this case, the string is `Hello\nworld`, which gets logged. ## Q. ***What is the output?*** @@ -6536,7 +6536,7 @@ If we wanted to get access to the resolved value `"I made it"`, we could have us This would've logged `"I made it!"` ## Q. ***What is the output?*** @@ -6562,7 +6562,7 @@ The `.push()` method returns the _length_ of the new array! Previously, the arra The `push` method modifies the original array. If you wanted to return the _array_ from the function rather than the _length of the array_, you should have returned `list` after pushing `item` to it. ## Q. ***What is the output?*** @@ -6592,7 +6592,7 @@ When we create the variable `shape` and set it equal to the frozen object `box`, Since `shape` is frozen, and since the value of `x` is not an object, we cannot modify the property `x`. `x` is still equal to `10`, and `{ x: 10, y: 20 }` gets logged. ## Q. ***What is the output?*** @@ -6617,7 +6617,7 @@ With `{ name: myName }`, we tell JavaScript that we want to create a new variabl Since we try to log `name`, a variable that is not defined, a ReferenceError gets thrown. ## Q. ***Is this a pure function?*** @@ -6638,7 +6638,7 @@ A pure function is a function that _always_ returns the same result, if the same The `sum` function always returns the same result. If we pass `1` and `2`, it will _always_ return `3` without side effects. If we pass `5` and `10`, it will _always_ return `15`, and so on. This is the definition of a pure function. ## Q. ***What is the output?*** @@ -6681,7 +6681,7 @@ The second time, the `cache` object contains the value that gets returned for `1 The third time, we pass `5 * 2` to the function which gets evaluated to `10`. The `cache` object contains the value that gets returned for `10`. The condition of the if-statement `num in cache` returns `true`, and `'From cache! 20'` gets logged. ## Q. ***What is the output?*** @@ -6714,7 +6714,7 @@ Where the keys are the enumerable properties. `0` `1` `2` `3` get logged. With a _for-of_ loop, we can iterate over **iterables**. An array is an iterable. When we iterate over the array, the variable "item" is equal to the element it's currently iterating over, `"☕"` ` "💻"` `"🍷"` `"🍫"` get logged. ## Q. ***What is the output?*** @@ -6736,7 +6736,7 @@ Array elements can hold any value. Numbers, strings, objects, other arrays, null The element will be equal to the returned value. `1 + 2` returns `3`, `1 * 2` returns `2`, and `1 / 2` returns `0.5`. ## Q. ***What is the output?*** @@ -6765,7 +6765,7 @@ In ES6, we can overwrite this default `undefined` value with default parameters. In this case, if we didn't pass a value or if we passed `undefined`, `name` would always be equal to the string `Lydia` ## Q. ***What is the output?*** @@ -6800,7 +6800,7 @@ The value of the `this` keyword is dependent on where you use it. In a **method* With the `call` method, we can change the object to which the `this` keyword refers. In **functions**, the `this` keyword refers to the _the object that the function belongs to_. We declared the `setTimeout` function on the _global object_, so within the `setTimeout` function, the `this` keyword refers to the _global object_. On the global object, there is a variable called _status_ with the value of `"😎"`. When logging `this.status`, `"😎"` gets logged. ## Q. ***What is the output?*** @@ -6833,7 +6833,7 @@ Then, we set `city` equal to the string `"Amsterdam"`. This doesn't change the p When logging the `person` object, the unmodified object gets returned. ## Q. ***What is the output?*** @@ -6862,7 +6862,7 @@ console.log(checkAge(21)); Variables with the `const` and `let` keyword are _block-scoped_. A block is anything between curly brackets (`{ }`). In this case, the curly brackets of the if/else statements. You cannot reference a variable outside of the block it's declared in, a ReferenceError gets thrown. ## Q. ***What kind of information would get logged?*** @@ -6883,7 +6883,7 @@ fetch("https://www.website.com/api/user/1") The value of `res` in the second `.then` is equal to the returned value of the previous `.then`. You can keep chaining `.then`s like this, where the value is passed to the next handler. ## Q. ***Which option is a way to set `hasName` equal to `true`, provided you cannot pass `true` as an argument?*** @@ -6910,7 +6910,7 @@ By setting `hasName` equal to `name`, you set `hasName` equal to whatever value `name.length` returns the length of the passed argument, not whether it's `true`. ## Q. ***What is the output?*** @@ -6931,7 +6931,7 @@ In order to get an character on a specific index in a string, you can use bracke Note that this method is not supported in IE7 and below. In that case, use `.charAt()` ## Q. ***What is the output?*** @@ -6956,7 +6956,7 @@ You can set a default parameter's value equal to another parameter of the functi If you're trying to set a default parameter's value equal to a parameter which is defined _after_ (to the right), the parameter's value hasn't been initialized yet, which will throw an error. ## Q. ***What is the output?*** @@ -6984,7 +6984,7 @@ With the `import * as name` syntax, we import _all exports_ from the `module.js` The `data` object has a `default` property for the default export, other properties have the names of the named exports and their corresponding values. ## Q. ***What is the output?*** @@ -7018,7 +7018,7 @@ function Person() { Calling a function constructor with `new` results in the creation of an instance of `Person`, `typeof` keyword returns `"object"` for an instance. `typeof member` returns `"object"`. ## Q. ***What is the output?*** @@ -7041,7 +7041,7 @@ The `.push` method returns the _new length_ of the array, not the array itself! Then, we try to use the `.push` method on `newList`. Since `newList` is the numerical value `4`, we cannot use the `.push` method: a TypeError is thrown. ## Q. ***What is the output?*** @@ -7068,7 +7068,7 @@ console.log(giveLydiaChocolate.prototype); Regular functions, such as the `giveLydiaPizza` function, have a `prototype` property, which is an object (prototype object) with a `constructor` property. Arrow functions however, such as the `giveLydiaChocolate` function, do not have this `prototype` property. `undefined` gets returned when trying to access the `prototype` property using `giveLydiaChocolate.prototype`. ## Q. ***What is the output?*** @@ -7101,7 +7101,7 @@ The first subarray is `[ "name", "Lydia" ]`, with `x` equal to `"name"`, and `y` The second subarray is `[ "age", 21 ]`, with `x` equal to `"age"`, and `y` equal to `21`, which get logged. ## Q. ***What is the output?*** @@ -7134,7 +7134,7 @@ getItems(["banana", "apple"], "pear", "orange"); The above example works. This returns the array `[ 'banana', 'apple', 'orange', 'pear' ]` ## Q. ***What is the output?*** @@ -7170,7 +7170,7 @@ a + b; This means that `a + b` is never reached, since a function stops running after the `return` keyword. If no value gets returned, like here, the function returns `undefined`. Note that there is no automatic insertion after `if/else` statements! ## Q. ***What is the output?*** @@ -7202,7 +7202,7 @@ console.log(member.name); We can set classes equal to other classes/function constructors. In this case, we set `Person` equal to `AnotherPerson`. The name on this constructor is `Sarah`, so the name property on the new `Person` instance `member` is `"Sarah"`. ## Q. ***What is the output?*** @@ -7228,7 +7228,7 @@ A Symbol is not _enumerable_. The Object.keys method returns all _enumerable_ ke This is one of the many qualities of a symbol: besides representing an entirely unique value (which prevents accidental name collision on objects, for example when working with 2 libraries that want to add properties to the same object), you can also "hide" properties on objects this way (although not entirely. You can still access symbols using the `Object.getOwnPropertySymbols()` method). ## Q. ***What is the output?*** @@ -7264,7 +7264,7 @@ The `getUser` function receives an object. With arrow functions, we don't _have_ Since no value gets returned in this case, the function returns `undefined`. ## Q. ***What is the output?*** @@ -7290,7 +7290,7 @@ SyntaxErrors get thrown when you've written something that isn't valid JavaScrip ReferenceErrors get thrown when JavaScript isn't able to find a reference to a value that you're trying to access. ## Q. ***What is the value of output?*** @@ -7314,7 +7314,7 @@ You should${"" && `n't`} see a therapist after so much JavaScript lol`; `""` is a falsy value. If the left-hand value is falsy, nothing gets returned. `n't` doesn't get returned. ## Q. ***What is the value of output?*** @@ -7343,7 +7343,7 @@ With the `||` operator, we can return the first truthy operand. If all values ar `([] || 0 || "")`: the empty array`[]` is a truthy value. This is the first truthy value, which gets returned. `three` is equal to `[]`. ## Q. ***What is the value of output?*** @@ -7383,7 +7383,7 @@ With the await keyword in `secondFunction`, we literally pause the execution of This means that it waited for the `myPromise` to resolve with the value `I have resolved`, and only once that happened, we moved to the next line: `second` got logged. ## Q. ***What is the value of output?*** @@ -7416,7 +7416,7 @@ However, the second one is a string `"Lydia"`. `"Lydia"` is a string and `2` is `{ name: "Lydia" }` is an object. Neither a number nor an object is a string, so it stringifies both. Whenever we stringify a regular object, it becomes `"[Object object]"`. `"[Object object]"` concatenated with `"2"` becomes `"[Object object]2"`. ## Q. ***What is its value?*** @@ -7437,7 +7437,7 @@ We can pass any type of value we want to `Promise.resolve`, either a promise or In this case, we just passed the numerical value `5`. It returns a resolved promise with the value `5`. ## Q. ***What is its value?*** @@ -7472,7 +7472,7 @@ This means that both values have a reference to the same spot in memory, thus th The code block in the `else` statement gets run, and `They are the same!` gets logged. ## Q. ***What is its value?*** @@ -7505,7 +7505,7 @@ With dot notation, JavaScript tries to find the property on the object with that JavaScript interprets (or unboxes) statements. When we use bracket notation, it sees the first opening bracket `[` and keeps going until it finds the closing bracket `]`. Only then, it will evaluate the statement. If we would've used `colorConfig[colors[1]]`, it would have returned the value of the `red` property on the `colorConfig` object. ## Q. ***What is its value?*** @@ -7522,7 +7522,7 @@ console.log("❤️" === "❤️"); Under the hood, emojis are unicodes. The unicodes for the heart emoji is `"U+2764 U+FE0F"`. These are always the same for the same emojis, so we're comparing two equal strings to each other, which returns true. ## Q. ***Which of these methods modifies the original array?*** @@ -7550,7 +7550,7 @@ With `splice` method, we modify the original array by deleting, replacing or add `map`, `filter` and `slice` return a new array, `find` returns an element, and `reduce` returns a reduced value. ## Q. ***What is the output?*** @@ -7578,7 +7578,7 @@ In JavaScript, primitive data types (everything that's not an object) interact b Then, we change the value of the `favoriteFood` property on the `info` object. The `food` array hasn't changed, since the value of `favoriteFood` was merely a _copy_ of the value of the first element in the array, and doesn't have a reference to the same spot in memory as the element on `food[0]`. When we log food, it's still the original array, `['🍕', '🍫', '🥑', '🍔']`. ## Q. ***What does this method do?*** @@ -7611,7 +7611,7 @@ JSON.parse(jsonArray); // { name: 'Lydia' } ``` ## Q. ***What is the output?*** @@ -7651,7 +7651,7 @@ getName(); // Lydia ``` ## Q. ***What is the output?*** @@ -7698,7 +7698,7 @@ console.log(two.next().value); // undefined ``` ## Q. ***What is the output?*** @@ -7717,7 +7717,7 @@ console.log(`${((x) => x)("I love")} to program`); Expressions within template literals are evaluated first. This means that the string will contain the returned value of the expression, the immediately invoked function `(x => x)('I love')` in this case. We pass the value `'I love'` as an argument to the `x => x` arrow function. `x` is equal to `'I love'`, which gets returned. This results in `I love to program`. ## Q. ***What will happen?*** @@ -7742,7 +7742,7 @@ config = null; Normally when we set objects equal to `null`, those objects get _garbage collected_ as there is no reference anymore to that object. However, since the callback function within `setInterval` is an arrow function (thus bound to the `config` object), the callback function still holds a reference to the `config` object. As long as there is a reference, the object won't get garbage collected. Since it's not garbage collected, the `setInterval` callback function will still get invoked every 1000ms (1s). ## Q. ***Which method(s) will return the value `'Hello world!'`?*** @@ -7774,7 +7774,7 @@ When adding a key/value pair using the `set` method, the key will be the value o 3 is wrong, since we're creating a new function by passing it as a parameter to the `get` method. Object interact by _reference_. Functions are objects, which is why two functions are never strictly equal, even if they are identical: they have a reference to a different spot in memory. ## Q. ***What is the output?*** @@ -7811,7 +7811,7 @@ First, we invoke the `changeAge` function and pass the `person` object as its ar Then, we invoke the `changeAgeAndName` function, however we don't pass a parameter. Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it's a new object, it doesn't affect the values of the properties on the `person` object. `person` is still equal to `{ name: "Lydia", age: 22 }`. ## Q. ***Predict the output*** @@ -7823,7 +7823,7 @@ if(2 == false) // returns false ``` ## Q. ***Being told that an unsorted array contains (n - 1) of n consecutive numbers (where the bounds are defined), find the missing number in O(n) time?*** @@ -7860,7 +7860,7 @@ function findMissingNumber(arrayOfIntegers, upperBound, lowerBound) { ``` ## Q. ***How will you remove duplicates from an array in JavaScript?*** @@ -7930,7 +7930,7 @@ function uniqueArray(array) { ``` ## Q. ***Given a string, reverse each word in the sentence*** @@ -7951,7 +7951,7 @@ function reverseBySeparator(string, separator) { ``` ## Q. ***Implement enqueue and dequeue using only two stacks*** @@ -7983,7 +7983,7 @@ function dequeue(stackInput, stackOutput) { ``` ## Q. ***How would you use a closure to create a private counter?*** @@ -8014,7 +8014,7 @@ c.retrieve(); // => The counter is currently at: 14 ``` ## Q. ***How to divide an array in multiple equal parts in JS?*** @@ -8040,7 +8040,7 @@ split(lenth); **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/split-array-5od3rz)** ## Q. ***Write a random integers function to print integers with in a range?*** @@ -8062,7 +8062,7 @@ randomInteger(1, 100); // returns a random integer from 1 to 100 **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-random-integers-yd1cy8?file=/src/index.js)** ## Q. ***How to convert Decimal to Binary in JavaScript?*** @@ -8099,7 +8099,7 @@ console.log(val.toString(16)); // A ==> Hexadecimal Conversion **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-decimal-to-binary-uhyi8t?file=/src/index.js)** ## Q. ***How do you make first letter of the string in an uppercase?*** @@ -8121,7 +8121,7 @@ console.log(capitalizeFirstLetter("hello world")); // Hello World **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-capitalizefirstletter-dpjhky?file=/src/index.js)** ## Q. ***Write a function which will test string as a literal and as an object?*** @@ -8151,7 +8151,7 @@ console.log(check(objStr)); // It is an object of string **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-literal-vs-object-978dqw?file=/src/index.js)** ## Q. ***How do you reversing an array?*** @@ -8166,7 +8166,7 @@ console.log(numbers); // [1, 2, 3, 4 ,5] ``` ## Q. ***How do you find min and max value in an array?*** @@ -8188,7 +8188,7 @@ console.log(findMax(marks)); ``` ## Q. ***How do you find min and max values without Math functions?*** @@ -8224,7 +8224,7 @@ console.log(findMax(marks)); ``` ## Q. ***Write code for merge two JavaScript Object dynamically?*** @@ -8308,5 +8308,5 @@ function find_max(nums) { **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-code-practice-xjw5n3)** From 49f133d9986089b94a9ae52d4c7cab2531b76d6b Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Mon, 12 Sep 2022 19:37:51 +0530 Subject: [PATCH 020/117] Update README.md --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 0ebc105..978a51b 100644 --- a/README.md +++ b/README.md @@ -8310,3 +8310,24 @@ function find_max(nums) { + +## Q. Create a Promise to accept car names as argument and send response once the argument matches with Maruti? + +```js +async function myCars(name) { + const promise = new Promise((resolve, reject) => { + name === "Maruti" ? resolve(name) : reject(name); + }); + + const result = await promise; + console.log(result); // "resolved!" +} + +myCars("Maruti"); +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-promise-1tmrnp?file=/src/index.js)** + + From 313c1de975268851c74e41f884d53416ac0d1892 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sat, 22 Oct 2022 15:30:52 +0530 Subject: [PATCH 021/117] Update README.md --- README.md | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 978a51b..68c6b0d 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,26 @@
-## Q. ***Write a program in javascript. sum(2)(3);*** +## Q. ***Write a function to accept argument like `sum(num1)(num2);` or `sum(num1,num2);`*** -**Example:** Expected output is 5 +**Example 1:** + +```js +Input: sum(10)(20); +Output: 30 +Explanation: 10 + 20 = 30 +``` + +**Example 2:** + +```js +Input: sum(10, 20); +Output: 30 +Explanation: 10 + 20 = 30 +``` + +
Answer +

```javascript function sum(x, y) { @@ -19,10 +36,13 @@ function sum(x, y) { } } -console.log(sum(2,3)); // Outputs 5 -console.log(sum(2)(3)); // Outputs 5 +console.log(sum(10,20)); // Outputs 30 +console.log(sum(10)(20)); // Outputs 30 ``` +

+
+ **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-1-ypmjhl?file=/src/index.js)**
From b09d0f31c55bd5fb0df481e127c8cec51a761222 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sat, 22 Oct 2022 15:32:11 +0530 Subject: [PATCH 022/117] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 68c6b0d..f7e2bc2 100644 --- a/README.md +++ b/README.md @@ -40,11 +40,11 @@ console.log(sum(10,20)); // Outputs 30 console.log(sum(10)(20)); // Outputs 30 ``` +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-1-ypmjhl?file=/src/index.js)** +

-**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-1-ypmjhl?file=/src/index.js)** - From 47d166fa1952502abb2d88a3861d605ae5a673c0 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sat, 22 Oct 2022 16:06:56 +0530 Subject: [PATCH 023/117] Update README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f7e2bc2..7ce4d91 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ Explanation: 10 + 20 = 30 ```
Answer -

```javascript function sum(x, y) { @@ -42,14 +41,15 @@ console.log(sum(10)(20)); // Outputs 30 **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-1-ypmjhl?file=/src/index.js)** -

-## Q. ***How to validate file size and extension before upload?*** +## Q. ***Validate file size and extension before file upload in JavaScript?*** + +
Answer ```html @@ -89,6 +89,8 @@ File Extension: jpg **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-file-upload-fj17kh?file=/index.html)** +
+ From 40afac43f7286a24c9c11ef580161c64170f8ee7 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sat, 22 Oct 2022 16:45:20 +0530 Subject: [PATCH 024/117] Update README.md --- README.md | 228 ++++++++++++++++++++++-------------------------------- 1 file changed, 93 insertions(+), 135 deletions(-) diff --git a/README.md b/README.md index 7ce4d91..ad69e8d 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,8 @@ function sum(x, y) { } } -console.log(sum(10,20)); // Outputs 30 -console.log(sum(10)(20)); // Outputs 30 +console.log(sum(10,20)); +console.log(sum(10)(20)); ``` **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-1-ypmjhl?file=/src/index.js)** @@ -95,7 +95,9 @@ File Extension: jpg ↥ back to top
-## Q. ***Create captcha using javascript?*** +## Q. ***Create a captcha using javascript?*** + +
Answer ```html @@ -121,12 +123,16 @@ File Extension: jpg **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-captcha-mzyi2n?file=/index.html)** +
+ ## Q. ***Create a Stopwatch program in javascript?*** +
Answer + ```html @@ -201,12 +207,16 @@ File Extension: jpg **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-stopwatch-j6in1i?file=/index.html)** +
+ ## Q. ***Write a program to reverse a string?*** +
Answer + ```javascript function reverseString(str) { let stringRev = ""; @@ -216,35 +226,41 @@ function reverseString(str) { return stringRev; } console.log(reverseString("Hello")); - -// Output: olleH ``` **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-reversestring-sgm1ip?file=/src/index.js)** +
+ ## Q. ***How to check if object is empty or not in javaScript?*** +
Answer + ```javascript function isEmpty(obj) { return Object.keys(obj).length === 0; } const obj = {}; -console.log(isEmpty(obj)); // true +console.log(isEmpty(obj)); ``` **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-isempty-b7n04b?file=/src/index.js)** +
+ ## Q. ***JavaScript Regular Expression to validate Email*** +
Answer + ```javascript function validateEmail(email) { const re = /\S+@\S+\.\S+/; @@ -256,12 +272,16 @@ console.log(validateEmail("pradeep.vwa@gmail.com")); // true **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-validateemail-wfopym?file=/src/index.js)** +
+ ## Q. ***Use RegEx to test password strength in JavaScript?*** +
Answer + ```javascript let newPassword = "Pq5*@a{J"; const regularExpression = new RegExp( @@ -269,9 +289,7 @@ const regularExpression = new RegExp( ); if (!regularExpression.test(newPassword)) { - alert( - "Password should contain atleast one number and one special character !" - ); + alert("Password should contain atleast one number and one special character !"); } else { console.log("PASS"); } @@ -291,63 +309,15 @@ PASS **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-password-strength-cxl8xy)** - - -## Q. ***How to compare objects ES6?*** - -Example 01: - -```javascript -const matches = (obj, source) => - Object.keys(source).every( - (key) => obj.hasOwnProperty(key) && obj[key] === source[key] - ); - -console.log( - matches({ age: 25, hair: "long", beard: true }, { hair: "long", beard: true }) -); // true -console.log( - matches({ hair: "long", beard: true }, { age: 25, hair: "long", beard: true }) -); // false -console.log( - matches({ hair: "long", beard: true }, { age: 26, hair: "long", beard: true }) -); // false -``` - -Example 02: - -```javascript -const k1 = { fruit: "🥝" }; -const k2 = { fruit: "🥝" }; - -// Using JavaScript -JSON.stringify(k1) === JSON.stringify(k2); // true -``` - -Example 03: - -```javascript -const one = { - fruit: "🥝", - energy: "255kJ", -}; - -const two = { - energy: "255kJ", - fruit: "🥝", -}; - -// Using JavaScript -JSON.stringify(one) === JSON.stringify(two); // false -``` +
-## Q. ***How to remove array element based on object property?*** +## Q. ***Remove array element based on object property?*** + +
Answer ```javascript var myArray = [ @@ -365,13 +335,15 @@ Console.log(myArray); Output -``` +```js myArray = [ {field: "id", operator: "eq"} {field: "cStatus", operator: "eq"} ] ``` +
+ @@ -379,7 +351,7 @@ myArray = [ ## Q. ***Predict the output of the following JavaScript code?*** ```javascript -console.log(+"meow"); // Output: NaN +console.log(+"meow"); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -389,14 +361,14 @@ var result; for (var i = 5; i > 0; i--) { result = result + i; } -console.log(result); // Output: NaN +console.log(result); ``` ## Q. ***Predict the output of the following JavaScript code?*** ```javascript var a = 1.2; -console.log(typeof a); // Output: Number +console.log(typeof a); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -406,7 +378,7 @@ var x = 10; if (x) { let x = 4; } -console.log(x); // Output: 10 +console.log(x); ```
@@ -416,13 +388,13 @@ console.log(x); // Output: 10 ## Q. ***Predict the output of the following JavaScript code?*** ```javascript -console.log(0.1 + 0.2 == 0.3); // Output: false +console.log(0.1 + 0.2 == 0.3); ``` ## Q. ***Predict the output of the following JavaScript code?*** ```javascript -console.log(1 + -"1" + 2); // Output: 2 +console.log(1 + -"1" + 2); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -432,7 +404,7 @@ console.log(1 + -"1" + 2); // Output: 2 return (function (y) { console.log(x); })(10); -})(20); // Output: 20 +})(20); ```
@@ -447,7 +419,7 @@ var getNumber = function () { console.log(num); var num = 10; }; -getNumber(); // Output: undefined +getNumber(); ```
@@ -461,13 +433,13 @@ function f1() { num = 10; } f1(); -console.log("window.num: " + window.num); // output: 10 +console.log("window.num: " + window.num); ``` ## Q. ***Predict the output of the following JavaScript code?*** ```javascript -console.log("(null + undefined): " + (null + undefined)); // Output: NaN +console.log("(null + undefined): " + (null + undefined)); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -477,8 +449,8 @@ console.log("(null + undefined): " + (null + undefined)); // Output: NaN var a = (b = 3); })(); -console.log("value of a : " + a); // Output: undefined -console.log("value of b : " + b); // Output: 3 +console.log("value of a : " + a); +console.log("value of b : " + b); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -488,7 +460,7 @@ var y = 1; if (function f() {}) { y += typeof f; } -console.log(y); // Output: 1Object +console.log(y); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -499,7 +471,7 @@ if (1) { eval(function foo() {}); k += typeof foo; } -console.log(k); // Output: 1undefined +console.log(k); ```
@@ -514,16 +486,16 @@ if (1) { function foo() {} k += typeof foo; } -console.log(k); // Output: 1function +console.log(k); ``` ## Q. ***Predict the output of the following JavaScript code?*** ```javascript -console.log("(-1 / 0): " + -1 / 0); // Output: -Infinity -console.log("(1 / 0): " + 1 / 0); // Output: Infinity -console.log("(0 / 0): " + 0 / 0); // Output: NaN -console.log("(0 / 1): " + 0 / 1); // Output: 0 +console.log("(-1 / 0): " + -1 / 0); +console.log("(1 / 0): " + 1 / 0); +console.log("(0 / 0): " + 0 / 0); +console.log("(0 / 1): " + 0 / 1); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -533,11 +505,11 @@ var a = 4; var b = "5"; var c = 6; -console.log("(a + b): " + (a + b)); // Output: 45 -console.log("(a - b): " + (a - b)); // Output: -1 -console.log("(a * b): " + a * b); // Output: 20 -console.log("(a / b): " + a / b); // Output: 0.8 -console.log("(a % b): " + (a % b)); // Output: 4 +console.log("(a + b): " + (a + b)); +console.log("(a - b): " + (a - b)); +console.log("(a * b): " + a * b); +console.log("(a / b): " + a / b); +console.log("(a % b): " + (a % b)); ```
@@ -547,8 +519,8 @@ console.log("(a % b): " + (a % b)); // Output: 4 ## Q. ***Predict the output of the following JavaScript code?*** ```javascript -console.log("MAX : " + Math.max(10, 2, NaN)); // Output: NaN -console.log("MAX : " + Math.max()); // Output: -Infinity +console.log("MAX : " + Math.max(10, 2, NaN)); +console.log("MAX : " + Math.max()); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -558,8 +530,8 @@ console.log("MAX : " + Math.max()); // Output: -Infinity var a = (b = 3); })(); -console.log("a defined? " + (typeof a !== "undefined")); // Output: true -console.log("b defined? " + (typeof b !== "undefined")); // Output: true +console.log("a defined? " + (typeof a !== "undefined")); +console.log("b defined? " + (typeof b !== "undefined")); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -569,11 +541,11 @@ var myObject = { foo: "bar", func: function () { var self = this; - console.log("outer func: this.foo = " + this.foo); // Output: this.foo = bar - console.log("outer func: self.foo = " + self.foo); // Output: self.foo = bar + console.log("outer func: this.foo = " + this.foo); + console.log("outer func: self.foo = " + self.foo); (function () { - console.log("inner func: this.foo = " + this.foo); // Output: this.foo = function foo() {} - console.log("inner func: self.foo = " + self.foo); // Output: self.foo = bar + console.log("inner func: this.foo = " + this.foo); + console.log("inner func: self.foo = " + self.foo); })(); }, }; @@ -587,8 +559,8 @@ myObject.func(); ## Q. ***Predict the output of the following JavaScript code?*** ```javascript -console.log(0.1 + 0.2); // Output: 0.30000000000000004 -console.log(0.1 + 0.2 == 0.3); // Output: false +console.log(0.1 + 0.2); +console.log(0.1 + 0.2 == 0.3); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -604,7 +576,6 @@ console.log(0.1 + 0.2 == 0.3); // Output: false }, 0); console.log(4); })(); -// Output: 1, 4, 3, 2 ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -614,19 +585,19 @@ var arr1 = "john".split(""); var arr2 = arr1.reverse(); var arr3 = "jones".split(""); arr2.push(arr3); -console.log("array 1: length=" + arr1.length + " last=" + arr1.slice(-1)); //array 1: length=5 last=j,o,n,e,s -console.log("array 2: length=" + arr2.length + " last=" + arr2.slice(-1)); //array 2: length=5 last=j,o,n,e,s +console.log("array 1: length=" + arr1.length + " last=" + arr1.slice(-1)); +console.log("array 2: length=" + arr2.length + " last=" + arr2.slice(-1)); ``` ## Q. ***Predict the output of the following JavaScript code?*** ```javascript -console.log(1 + "2" + "2"); // Output: 122 -console.log(1 + +"2" + "2"); // Output: 32 -console.log(1 + -"1" + "2"); // Output: 02 -console.log(+"1" + "1" + "2"); // Output: 112 -console.log("A" - "B" + "2"); // Output: NaN2 -console.log("A" - "B" + 2); // Output: NaN +console.log(1 + "2" + "2"); +console.log(1 + +"2" + "2"); +console.log(1 + -"1" + "2"); +console.log(+"1" + "1" + "2"); +console.log("A" - "B" + "2"); +console.log("A" - "B" + 2); ```
@@ -641,7 +612,6 @@ for (var i = 0; i < 5; i++) { console.log(i); }, i * 1000); } -// Output: 145, 5, 5, 5, 5, 5 ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -660,10 +630,10 @@ for (var i = 0; i < 5; i++) { ## Q. ***Predict the output of the following JavaScript code?*** ```javascript -console.log("0 || 1 = " + (0 || 1)); // Output: 1 -console.log("1 || 2 = " + (1 || 2)); // Output: 1 -console.log("0 && 1 = " + (0 && 1)); // Output: 0 -console.log("1 && 2 = " + (1 && 2)); // Output: 2 +console.log("0 || 1 = " + (0 || 1)); +console.log("1 || 2 = " + (1 || 2)); +console.log("0 && 1 = " + (0 && 1)); +console.log("1 && 2 = " + (1 && 2)); ```
@@ -673,8 +643,8 @@ console.log("1 && 2 = " + (1 && 2)); // Output: 2 ## Q. ***Predict the output of the following JavaScript code?*** ```javascript -console.log(false == "0"); // Output: true -console.log(false === "0"); // Output: false +console.log(false == "0"); +console.log(false === "0"); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -686,7 +656,7 @@ var a = {}, a[b] = 123; a[c] = 456; -console.log(a[b]); // Output: 456 +console.log(a[b]); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -696,7 +666,7 @@ console.log( (function f(n) { return n > 1 ? n * f(n - 1) : n; })(10) -); // Output: 3628800 +); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -724,8 +694,8 @@ var hero = { }; var stoleSecretIdentity = hero.getSecretIdentity; -console.log(stoleSecretIdentity()); // Output: undefined -console.log(hero.getSecretIdentity()); // Output: John Doe +console.log(stoleSecretIdentity()); +console.log(hero.getSecretIdentity()); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -774,7 +744,7 @@ obj.method(fn, 1); ```javascript var x = 21; var girl = function () { - console.log(x); // Output: undefined + console.log(x); var x = 20; }; girl(); @@ -783,14 +753,14 @@ girl(); ## Q. ***Predict the output of the following JavaScript code?*** ```javascript -console.log(1 < 2 < 3); // Output: true -console.log(3 > 2 > 1); // Output: false +console.log(1 < 2 < 3); +console.log(3 > 2 > 1); ``` ## Q. ***Predict the output of the following JavaScript code?*** ```javascript -console.log(typeof typeof 1); // Output: string +console.log(typeof typeof 1); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -818,14 +788,14 @@ outer(); ```javascript x = 10; console.log(x); -var x; // Output: 10 +var x; ``` ## Q. ***Predict the output of the following JavaScript code?*** ```javascript const arr = [1, 2]; -arr.push(3); // Output: 1, 2, 3 +arr.push(3); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -845,7 +815,7 @@ o.constructor === F; let sum = (a, b) => { a + b; }; -console.log(sum(10, 20)); // Output: undefined; return keyword is missing +console.log(sum(10, 20)); ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -7876,9 +7846,6 @@ function findMissingNumber(arrayOfIntegers, upperBound, lowerBound) { return theoreticalSum - sumOfIntegers; } - -// Output -// 8 ```
@@ -7960,11 +7927,8 @@ function uniqueArray(array) { ```js var string = "Welcome to this Javascript Guide!"; -// Output becomes !ediuG tpircsavaJ siht ot emocleW - var reverseEntireSentence = reverseBySeparator(string, ""); -// Output becomes emocleW ot siht tpircsavaJ !ediuG var reverseEachWord = reverseBySeparator(reverseEntireSentence, " "); function reverseBySeparator(string, separator) { @@ -8051,12 +8015,6 @@ function split(len) { } } split(lenth); - -// Output -(3) [1, 2, 3] -(3) [4, 5, 6] -(3) [7, 8, 9] -(1) [10] ``` **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/split-array-5od3rz)** From afdce1df7d72921e26c35c25b9e1b8ebd21eb077 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sat, 22 Oct 2022 16:57:13 +0530 Subject: [PATCH 025/117] Update README.md --- README.md | 66 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index ad69e8d..29ca9da 100644 --- a/README.md +++ b/README.md @@ -236,7 +236,7 @@ console.log(reverseString("Hello")); ↥ back to top
-## Q. ***How to check if object is empty or not in javaScript?*** +## Q. ***Check if object is empty or not using javaScript?***
Answer @@ -584,7 +584,9 @@ console.log(0.1 + 0.2 == 0.3); var arr1 = "john".split(""); var arr2 = arr1.reverse(); var arr3 = "jones".split(""); + arr2.push(arr3); + console.log("array 1: length=" + arr1.length + " last=" + arr1.slice(-1)); console.log("array 2: length=" + arr2.length + " last=" + arr2.slice(-1)); ``` @@ -715,7 +717,6 @@ var obj = { }; obj.method(fn, 1); -//Output: 10, 2 ```
@@ -736,7 +737,6 @@ obj.method(fn, 1); console.log(x); console.log(y); })(); -//Output: 1, undefined, 2 ``` ## Q. ***Predict the output of the following JavaScript code?*** @@ -772,7 +772,7 @@ function outer() { function inner() { b++; var b = 3; - console.log(b); //3 + console.log(b); } inner(); } @@ -783,7 +783,7 @@ outer(); ↥ back to top
-## Q. ***Hoisting example in javascript?*** +## Q. ***Predict the output of the following JavaScript code?*** ```javascript x = 10; @@ -822,38 +822,23 @@ console.log(sum(10, 20)); ```javascript var arr = ["javascript", "typescript", "es6"]; + var searchValue = (value) => { return arr.filter((item) => { return item.indexOf(value) > -1; }); }; -console.log(searchValue("script")); -``` -## Q. ***Write the program using fatarrow function?*** - -```javascript -var a = [1, 2, 3, 4]; -function sumUsingFunction(acc, value) { - return acc + value; -} -var sumOfArrayUsingFunc = a.reduce(sumUsingFunc); +console.log(searchValue("script")); ``` ## Q. ***Write a program that prints the numbers from 1 to 15. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”?*** -```javascript -for (var i = 1; i <= 15; i++) { - if (i % 15 == 0) console.log("FizzBuzz"); - else if (i % 3 == 0) console.log("Fizz"); - else if (i % 5 == 0) console.log("Buzz"); - else console.log(i); -} -``` - -Output: +**Example:** -``` +```js +Input: 15 +Output: 1 2 Fizz @@ -871,7 +856,20 @@ Fizz FizzBuzz ``` -Solution - 02 +
Answer + +**Solution - 01:** + +```javascript +for (var i = 1; i <= 15; i++) { + if (i % 15 == 0) console.log("FizzBuzz"); + else if (i % 3 == 0) console.log("Fizz"); + else if (i % 5 == 0) console.log("Buzz"); + else console.log(i); +} +``` + +**Solution - 02:** ```javascript for (var i = 1; i <= 15; i++) { @@ -881,6 +879,8 @@ for (var i = 1; i <= 15; i++) { } ``` +
+ @@ -896,8 +896,16 @@ var output = (function (x) { console.log(output); ``` +
Answer + The code above will output `0` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **local variable**. `delete` operator doesn't affect local variables. +
+ + + ## Q. ***What will be the output of the following code?*** ```javascript @@ -910,8 +918,12 @@ var output = (function () { console.log(output); ``` +
Answer + The code above will output `1` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **global variable** of type `number`. +
+ From 30d2627e67575b3ba9cfc33b6b858a4f5b1d4886 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 23 Oct 2022 09:40:40 +0530 Subject: [PATCH 026/117] Update README.md --- README.md | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 69 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 29ca9da..9275259 100644 --- a/README.md +++ b/README.md @@ -940,8 +940,16 @@ var output = (function () { console.log(output); ``` +
Answer + The code above will output `undefined` as output. `delete` operator is used to delete a property from an object. Here `x` is an object which has foo as a property and from a self-invoking function, we are deleting the `foo` property of object `x` and after deletion, we are trying to reference deleted property `foo` which result `undefined`. +
+ + + ## Q. ***What will be the output of the following code?*** ```javascript @@ -953,10 +961,14 @@ delete emp1.company; console.log(emp1.company); ``` +
Answer + The code above will output `xyz` as output. Here `emp1` object got company as **prototype** property. delete operator doesn't delete prototype property. `emp1` object doesn't have **company** as its own property. you can test it `console.log(emp1.hasOwnProperty('company')); //output : false` However, we can delete company property directly from `Employee` object using `delete Employee.company` or we can also delete from `emp1` object using `__proto__` property `delete emp1.__proto__.company`. +
+ @@ -969,10 +981,18 @@ delete trees[3]; console.log(trees.length); ``` +
Answer + The code above will output `5` as output. When we used `delete` operator for deleting an array element then, the array length is not affected by this. This holds even if you deleted all elements of an array using `delete` operator. So when delete operator removes an array element that deleted element is no longer present in the array. In place of value at deleted index `undefined x 1` in **chrome** and `undefined` is placed at the index. If you do `console.log(trees)` output `["xyz", "xxxx", "test", undefined × 1, "apple"]` in Chrome and in Firefox `["xyz", "xxxx", "test", undefined, "apple"]`. +
+ + + ## Q. ***What will be the output of the following code?*** ```javascript @@ -983,6 +1003,8 @@ console.log(bar + true); console.log(bar + false); ``` +
Answer + The code above will output `1, "truexyz", 2, 1` as output. Here's a general guideline for the plus operator: - Number + Number -> Addition @@ -992,6 +1014,8 @@ The code above will output `1, "truexyz", 2, 1` as output. Here's a general guid - String + Boolean -> Concatenation - String + String -> Concatenation +
+ @@ -1004,6 +1028,8 @@ var z = 1, console.log(y); ``` +
Answer + The code above will print string `"undefined"` as output. According to associativity rule operator with the same precedence are processed based on their associativity property of operator. Here associativity of the assignment operator is `Right to Left` so first `typeof y` will evaluate first which is string `"undefined"` and assigned to `z` and then `y` would be assigned the value of z. The overall sequence will look like that: ```javascript @@ -1014,6 +1040,8 @@ z = typeof y; y = z; ``` +
+ ## Q. ***What will be the output of the following code?*** ```javascript @@ -1024,9 +1052,11 @@ var foo = function bar() { typeof bar(); ``` +
Answer + The output will be `Reference Error`. To fix the bug we can try to rewrite the code a little bit: -**Sample 1** +**Sample 1:** ```javascript var bar = function () { @@ -1037,7 +1067,7 @@ typeof bar(); or -**Sample 2** +**Sample 2:** ```javascript function bar() { @@ -1058,6 +1088,8 @@ var foo = function bar() { // bar is undefined here ``` +
+ @@ -1074,15 +1106,23 @@ function bar() { } ``` +
Answer + The output will be : -``` +```js bar got called something ``` Since the function is called first and defined during parse time the JS engine will try to find any possible parse time definitions and start the execution loop which will mean function is called first even if the definition is post another function. +
+ + + ## Q. ***What will be the output of the following code?*** ```javascript @@ -1097,6 +1137,8 @@ var salary = "1000$"; })(); ``` +
Answer + The code above will output: `undefined, 5000$` because of hoisting. In the code presented above, you might be expecting `salary` to retain it values from outer scope until the point that `salary` was re-declared in the inner scope. But due to `hoisting` salary value was `undefined` instead. To understand it better have a look of the following code, here `salary` variable is hoisted and declared at the top in function scope. When we print its value using `console.log` the result is `undefined`. Afterwards the variable is redeclared and the new value `"5000$"` is assigned to it. ```javascript @@ -1112,6 +1154,8 @@ var salary = "1000$"; })(); ``` +
+ @@ -1127,6 +1171,8 @@ var person = (new User("xyz")["location"] = "USA"); console.log(person); ``` +
Answer + The output of above code would be `"USA"`. Here `new User("xyz")` creates a brand new object and created property `location` on that and `USA` has been assigned to object property location and that has been referenced by the person. Let say `new User("xyz")` created a object called `foo`. The value `"USA"` will be assigned to `foo["location"]`, but according to [ECMAScript Specification](http://www.ecma-international.org/ecma-262/6.0/#sec-assignment-operators-runtime-semantics-evaluation) , pt 12.14.4 the assignment will itself return the rightmost value: in our case it's `"USA"`. @@ -1136,7 +1182,7 @@ To better understand What is going on here, try to execute this code in console, ```javascript function User(name) { - this.name = name || "JsGeeks"; + this.name = name || "JS"; } var person; @@ -1145,6 +1191,8 @@ foo["location"] = "USA"; // the console will show you that the result of this is "USA" ``` +
+ @@ -1158,9 +1206,13 @@ strB = "bye there!"; console.log(strA); ``` +
Answer + The output will `'hi there'` because we're dealing with strings here. Strings are passed by value, that is, copied. +
+ @@ -1174,9 +1226,17 @@ objB.prop1 = 90; console.log(objA); ``` +
Answer + The output will `{prop1: 90}` because we're dealing with objects here. Objects are passed by reference, that is, `objA` and `objB` point to the same object in memory. +
+ + + ## Q. ***What would be the output of following code?*** ```javascript @@ -1186,13 +1246,17 @@ objB = {}; console.log(objA); ``` +
Answer + The output will `{prop1: 42}`. When we assign `objA` to `objB`, the `objB` variable will point to the same object as the `objB` variable. However, when we reassign `objB` to an empty object, we simply change where `objB` variable references to. -This doesn't affect where `objA` variable references to. +This doesn\'t affect where `objA` variable references to. + +
↥ back to top From edcc0104cf6ff1555377bb4d1f7ac59cc394b70c Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 23 Oct 2022 10:53:06 +0530 Subject: [PATCH 027/117] Update README.md --- README.md | 9954 +++++++++++++++++++++++++++-------------------------- 1 file changed, 5003 insertions(+), 4951 deletions(-) diff --git a/README.md b/README.md index 9275259..eea47db 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@
-## Q. ***Write a function to accept argument like `sum(num1)(num2);` or `sum(num1,num2);`*** +## Q. Write a function to accept argument like `sum(num1)(num2);` or `sum(num1,num2);` **Example 1:** @@ -47,7 +47,7 @@ console.log(sum(10)(20)); ↥ back to top
-## Q. ***Validate file size and extension before file upload in JavaScript?*** +## Q. Validate file size and extension before file upload in JavaScript?
Answer @@ -95,7 +95,7 @@ File Extension: jpg ↥ back to top
-## Q. ***Create a captcha using javascript?*** +## Q. Create a captcha using javascript?
Answer @@ -129,7 +129,7 @@ File Extension: jpg ↥ back to top
-## Q. ***Create a Stopwatch program in javascript?*** +## Q. Create a Stopwatch program in javascript?
Answer @@ -213,7 +213,7 @@ File Extension: jpg ↥ back to top
-## Q. ***Write a program to reverse a string?*** +## Q. Write a program to reverse a string?
Answer @@ -236,959 +236,1117 @@ console.log(reverseString("Hello")); ↥ back to top
-## Q. ***Check if object is empty or not using javaScript?*** +## Q. Create a Promise to accept car names as argument and send response once the argument matches with Maruti? -
Answer +```js +async function myCars(name) { + const promise = new Promise((resolve, reject) => { + name === "Maruti" ? resolve(name) : reject(name); + }); -```javascript -function isEmpty(obj) { - return Object.keys(obj).length === 0; + const result = await promise; + console.log(result); // "resolved!" } -const obj = {}; -console.log(isEmpty(obj)); +myCars("Maruti"); ``` -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-isempty-b7n04b?file=/src/index.js)** - -
+**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-promise-1tmrnp?file=/src/index.js)** -## Q. ***JavaScript Regular Expression to validate Email*** +## Q. Write code for merge two JavaScript Object dynamically? -
Answer +Let say you have two objects -```javascript -function validateEmail(email) { - const re = /\S+@\S+\.\S+/; - return re.test(email); -} +```js +const person = { + name: "Tanvi", + age: 28 +}; -console.log(validateEmail("pradeep.vwa@gmail.com")); // true +const address = { + addressLine1: "Some Location x", + addressLine2: "Some Location y", + city: "Bangalore" +}; ``` -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-validateemail-wfopym?file=/src/index.js)** +Write merge function which will take two object and add all the own property of second object into first object. -
+```js +merge(person , address); + +/* Now person should have 5 properties +name , age , addressLine1 , addressLine2 , city */ +``` - +**Method 1: Using ES6, Object.assign method:** -## Q. ***Use RegEx to test password strength in JavaScript?*** +```js +const merge = (toObj, fromObj) => Object.assign(toObj, fromObj); -
Answer +console.log(merge(person, address)); +// {name: "Tanvi", age: 28, addressLine1: "Some Location x", addressLine2: "Some Location y", city: "Bangalore"} +``` -```javascript -let newPassword = "Pq5*@a{J"; -const regularExpression = new RegExp( - "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})" -); +**Method 2: Without using built-in function:** -if (!regularExpression.test(newPassword)) { - alert("Password should contain atleast one number and one special character !"); -} else { - console.log("PASS"); +```js +function mergeObject(toObj, fromObj) { + // Make sure both of the parameter is an object + if (typeof toObj === "object" && typeof fromObj === "object") { + for (var pro in fromObj) { + // Assign only own properties not inherited properties + if (fromObj.hasOwnProperty(pro)) { + // Assign property and value + toObj[pro] = fromObj[pro]; + } + } + } else { + throw "Merge function can apply only on object"; + } } -// Output -PASS +console.log(mergeObject(person, address)); +// {name: "Tanvi", age: 28, addressLine1: "Some Location x", addressLine2: "Some Location y", city: "Bangalore"} ``` -| RegEx | Description | -| ---------------- |--------------| -| ^ | The password string will start this way | -| (?=.\*[a-z]) | The string must contain at least 1 lowercase alphabetical character | -| (?=.\*[A-Z]) | The string must contain at least 1 uppercase alphabetical character | -| (?=.\*[0-9]) | The string must contain at least 1 numeric character | -| (?=.[!@#\$%\^&]) | The string must contain at least one special character, but we are escaping reserved RegEx characters to avoid conflict | -| (?=.{8,}) | The string must be eight characters or longer | - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-password-strength-cxl8xy)** +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-shallow-vs-deep-copy-ik5b7h?file=/src/index.js)** -
- +## Q. Being told that an unsorted array contains (n - 1) of n consecutive numbers (where the bounds are defined), find the missing number in O(n) time? -## Q. ***Remove array element based on object property?*** +```js +// The output of the function should be 8 +var arrayOfIntegers = [2, 5, 1, 4, 9, 6, 3, 7]; +var upperBound = 9; +var lowerBound = 1; -
Answer +findMissingNumber(arrayOfIntegers, upperBound, lowerBound); // 8 -```javascript -var myArray = [ - { field: "id", operator: "eq" }, - { field: "cStatus", operator: "eq" }, - { field: "money", operator: "eq" }, -]; +function findMissingNumber(arrayOfIntegers, upperBound, lowerBound) { + // Iterate through array to find the sum of the numbers + var sumOfIntegers = 0; + for (var i = 0; i < arrayOfIntegers.length; i++) { + sumOfIntegers += arrayOfIntegers[i]; + } -myArray = myArray.filter(function (obj) { - return obj.field !== "money"; -}); + // Find theoretical sum of the consecutive numbers using a variation of Gauss Sum. + // Formula: [(N * (N + 1)) / 2] - [(M * (M - 1)) / 2]; + // N is the upper bound and M is the lower bound -Console.log(myArray); -``` + upperLimitSum = (upperBound * (upperBound + 1)) / 2; + lowerLimitSum = (lowerBound * (lowerBound - 1)) / 2; -Output + theoreticalSum = upperLimitSum - lowerLimitSum; -```js -myArray = [ - {field: "id", operator: "eq"} - {field: "cStatus", operator: "eq"} -] + return theoreticalSum - sumOfIntegers; +} ``` -
- -## Q. ***Predict the output of the following JavaScript code?*** +## Q. How will you remove duplicates from an array in JavaScript? +**a.) Using set()** ```javascript -console.log(+"meow"); -``` +const names = ['John', 'Paul', 'George', 'Ringo', 'John']; -## Q. ***Predict the output of the following JavaScript code?*** +let unique = [...new Set(names)]; +console.log(unique); // 'John', 'Paul', 'George', 'Ringo' +``` +**b.) Using filter()** +```javascript +const names = ['John', 'Paul', 'George', 'Ringo', 'John']; +let x = (names) => names.filter((v,i) => names.indexOf(v) === i) +x(names); // 'John', 'Paul', 'George', 'Ringo' +``` +**c.) Using forEach()** ```javascript -var result; -for (var i = 5; i > 0; i--) { - result = result + i; +const names = ['John', 'Paul', 'George', 'Ringo', 'John']; + +function removeDups(names) { + let unique = {}; + names.forEach(function(i) { + if(!unique[i]) { + unique[i] = true; + } + }); + return Object.keys(unique); } -console.log(result); + +removeDups(names); // // 'John', 'Paul', 'George', 'Ringo' ``` -## Q. ***Predict the output of the following JavaScript code?*** +**d.) Using set()** -```javascript -var a = 1.2; -console.log(typeof a); +```js +// ES6 Implementation +var array = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; + +Array.from(new Set(array)); // [1, 2, 3, 5, 9, 8] ``` -## Q. ***Predict the output of the following JavaScript code?*** +**e.) Using Hashmap** -```javascript -var x = 10; -if (x) { - let x = 4; +```js +// ES5 Implementation +var array = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; + +uniqueArray(array); // [1, 2, 3, 5, 9, 8] + +function uniqueArray(array) { + var hashmap = {}; + var unique = []; + + for(var i = 0; i < array.length; i++) { + // If key returns undefined (unique), it is evaluated as false. + if(!hashmap.hasOwnProperty(array[i])) { + hashmap[array[i]] = 1; + unique.push(array[i]); + } + } + + return unique; } -console.log(x); ``` -## Q. ***Predict the output of the following JavaScript code?*** - -```javascript -console.log(0.1 + 0.2 == 0.3); -``` +## Q. Given a string, reverse each word in the sentence -## Q. ***Predict the output of the following JavaScript code?*** +```js +var string = "Welcome to this Javascript Guide!"; -```javascript -console.log(1 + -"1" + 2); -``` +var reverseEntireSentence = reverseBySeparator(string, ""); -## Q. ***Predict the output of the following JavaScript code?*** +var reverseEachWord = reverseBySeparator(reverseEntireSentence, " "); -```javascript -(function (x) { - return (function (y) { - console.log(x); - })(10); -})(20); +function reverseBySeparator(string, separator) { + return string.split(separator).reverse().join(separator); +} ``` -## Q. ***Predict the output of the following JavaScript code?*** +## Q. Implement enqueue and dequeue using only two stacks -```javascript -var num = 20; -var getNumber = function () { - console.log(num); - var num = 10; -}; -getNumber(); +Enqueue means to add an element, dequeue to remove an element. + +```js +var inputStack = []; // First stack +var outputStack = []; // Second stack + +// For enqueue, just push the item into the first stack +function enqueue(stackInput, item) { + return stackInput.push(item); +} + +function dequeue(stackInput, stackOutput) { + // Reverse the stack such that the first element of the output stack is the + // last element of the input stack. After that, pop the top of the output to + // get the first element that was ever pushed into the input stack + if (stackOutput.length <= 0) { + while(stackInput.length > 0) { + var elementToOutput = stackInput.pop(); + stackOutput.push(elementToOutput); + } + } + + return stackOutput.pop(); +} ``` -## Q. ***Predict the output of the following JavaScript code?*** +## Q. How would you use a closure to create a private counter? -```javascript -function f1() { - num = 10; +You can create a function within an outer function (a closure) that allows you to update a private variable but the variable wouldn\'t be accessible from outside the function without the use of a helper function. + +```js +function counter() { + var _counter = 0; + // return an object with several functions that allow you + // to modify the private _counter variable + return { + add: function(increment) { _counter += increment; }, + retrieve: function() { return 'The counter is currently at: ' + _counter; } + } } -f1(); -console.log("window.num: " + window.num); -``` -## Q. ***Predict the output of the following JavaScript code?*** +// error if we try to access the private variable like below +// _counter; + +// usage of our counter function +var c = counter(); +c.add(5); +c.add(9); -```javascript -console.log("(null + undefined): " + (null + undefined)); +// now we can access the private variable in the following way +c.retrieve(); // => The counter is currently at: 14 ``` -## Q. ***Predict the output of the following JavaScript code?*** - -```javascript -(function () { - var a = (b = 3); -})(); + -console.log("value of a : " + a); -console.log("value of b : " + b); -``` +## Q. How to divide an array in multiple equal parts in JS? -## Q. ***Predict the output of the following JavaScript code?*** +```js +const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +let lenth = 3; -```javascript -var y = 1; -if (function f() {}) { - y += typeof f; +function split(len) { + while (arr.length > 0) { + console.log(arr.splice(0, len)); + } } -console.log(y); +split(lenth); ``` -## Q. ***Predict the output of the following JavaScript code?*** +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/split-array-5od3rz)** -```javascript -var k = 1; -if (1) { - eval(function foo() {}); - k += typeof foo; + + +## Q. Write a random integers function to print integers with in a range? + +**Example:** + +```js +/** + * function to return a random number + * between min and max range + * + * */ +function randomInteger(min, max) { + return Math.floor(Math.random() * (max - min + 1) ) + min; } -console.log(k); +randomInteger(1, 100); // returns a random integer from 1 to 100 ``` +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-random-integers-yd1cy8?file=/src/index.js)** + -## Q. ***Predict the output of the following JavaScript code?*** +## Q. How to convert Decimal to Binary in JavaScript? -```javascript -var k = 1; -if (1) { - function foo() {} - k += typeof foo; -} -console.log(k); -``` +**Example 01:** Convert Decimal to Binary -## Q. ***Predict the output of the following JavaScript code?*** +```js +function DecimalToBinary(number) { + let bin = 0; + let rem, + i = 1; + while (number !== 0) { + rem = number % 2; + number = parseInt(number / 2); + bin = bin + rem * i; + i = i * 10; + } + console.log(`Binary: ${bin}`); +} -```javascript -console.log("(-1 / 0): " + -1 / 0); -console.log("(1 / 0): " + 1 / 0); -console.log("(0 / 0): " + 0 / 0); -console.log("(0 / 1): " + 0 / 1); +DecimalToBinary(10); ``` -## Q. ***Predict the output of the following JavaScript code?*** +**Example 02:** Convert Decimal to Binary Using `toString()` -```javascript -var a = 4; -var b = "5"; -var c = 6; +```js +let val = 10; -console.log("(a + b): " + (a + b)); -console.log("(a - b): " + (a - b)); -console.log("(a * b): " + a * b); -console.log("(a / b): " + a / b); -console.log("(a % b): " + (a % b)); +console.log(val.toString(2)); // 1010 ==> Binary Conversion +console.log(val.toString(8)); // 12 ==> Octal Conversion +console.log(val.toString(16)); // A ==> Hexadecimal Conversion ``` +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-decimal-to-binary-uhyi8t?file=/src/index.js)** + -## Q. ***Predict the output of the following JavaScript code?*** +## Q. How do you make first letter of the string in an uppercase? -```javascript -console.log("MAX : " + Math.max(10, 2, NaN)); -console.log("MAX : " + Math.max()); -``` - -## Q. ***Predict the output of the following JavaScript code?*** +You can create a function which uses chain of string methods such as charAt, toUpperCase and slice methods to generate a string with first letter in uppercase. -```javascript -(function () { - var a = (b = 3); -})(); +```js +function capitalizeFirstLetter(string) { + let arr = string.split(" "); + for (var i = 0; i < arr.length; i++) { + arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1); + } + return arr.join(" "); +} -console.log("a defined? " + (typeof a !== "undefined")); -console.log("b defined? " + (typeof b !== "undefined")); +console.log(capitalizeFirstLetter("hello world")); // Hello World ``` -## Q. ***Predict the output of the following JavaScript code?*** - -```javascript -var myObject = { - foo: "bar", - func: function () { - var self = this; - console.log("outer func: this.foo = " + this.foo); - console.log("outer func: self.foo = " + self.foo); - (function () { - console.log("inner func: this.foo = " + this.foo); - console.log("inner func: self.foo = " + self.foo); - })(); - }, -}; -myObject.func(); -``` +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-capitalizefirstletter-dpjhky?file=/src/index.js)** -## Q. ***Predict the output of the following JavaScript code?*** +## Q. Write a function which will test string as a literal and as an object? -```javascript -console.log(0.1 + 0.2); -console.log(0.1 + 0.2 == 0.3); -``` +The `typeof` operator can be use to test string literal and `instanceof` operator to test String object. -## Q. ***Predict the output of the following JavaScript code?*** +```js +function check(str) { + if (str instanceof String) { + return "It is an object of string"; + } else { + if (typeof str === "string") { + return "It is a string literal"; + } else { + return "another type"; + } + } +} -```javascript -(function () { - console.log(1); - setTimeout(function () { - console.log(2); - }, 1000); - setTimeout(function () { - console.log(3); - }, 0); - console.log(4); -})(); -``` +var ltrlStr = "Hi I am string literal"; +var objStr = new String("Hi I am string object"); -## Q. ***Predict the output of the following JavaScript code?*** +console.log(check(ltrlStr)); // It is a string literal +console.log(check(objStr)); // It is an object of string +``` -```javascript -var arr1 = "john".split(""); -var arr2 = arr1.reverse(); -var arr3 = "jones".split(""); +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-literal-vs-object-978dqw?file=/src/index.js)** -arr2.push(arr3); + -console.log("array 1: length=" + arr1.length + " last=" + arr1.slice(-1)); -console.log("array 2: length=" + arr2.length + " last=" + arr2.slice(-1)); -``` +## Q. How do you reversing an array? -## Q. ***Predict the output of the following JavaScript code?*** +You can use reverse() method is used reverse the elements in an array. This method is useful to sort an array in descending order. Let us see the usage of reverse() method in an example, -```javascript -console.log(1 + "2" + "2"); -console.log(1 + +"2" + "2"); -console.log(1 + -"1" + "2"); -console.log(+"1" + "1" + "2"); -console.log("A" - "B" + "2"); -console.log("A" - "B" + 2); +```js +let numbers = [1, 2, 5, 3, 4]; +numbers.sort((a, b) => b - a); +numbers.reverse(); +console.log(numbers); // [1, 2, 3, 4 ,5] ``` -## Q. ***Predict the output of the following JavaScript code?*** - -```javascript -for (var i = 0; i < 5; i++) { - setTimeout(function () { - console.log(i); - }, i * 1000); -} -``` +## Q. How do you find min and max value in an array? -## Q. ***Predict the output of the following JavaScript code?*** +You can use `Math.min` and `Math.max` methods on array variable to find the minimum and maximum elements with in an array. +Let us create two functions to find the min and max value with in an array, -```javascript -for (var i = 0; i < 5; i++) { - (function (x) { - setTimeout(function () { - console.log(x); - }, x * 1000); - })(i); +```js +var marks = [50, 20, 70, 60, 45, 30]; +function findMin(arr) { + return Math.min.apply(null, arr); +} +function findMax(arr) { + return Math.max.apply(null, arr); } -//Output:- 0, 1, 2, 3, 4 -``` - -## Q. ***Predict the output of the following JavaScript code?*** -```javascript -console.log("0 || 1 = " + (0 || 1)); -console.log("1 || 2 = " + (1 || 2)); -console.log("0 && 1 = " + (0 && 1)); -console.log("1 && 2 = " + (1 && 2)); +console.log(findMin(marks)); +console.log(findMax(marks)); ``` -## Q. ***Predict the output of the following JavaScript code?*** +## Q. How do you find min and max values without Math functions? -```javascript -console.log(false == "0"); -console.log(false === "0"); -``` +You can write functions which loops through an array comparing each value with the lowest value or highest value to find the min and max values. Let us create those functions to find min an max values, -## Q. ***Predict the output of the following JavaScript code?*** +```js +var marks = [50, 20, 70, 60, 45, 30]; +function findMin(arr) { + var length = arr.length + var min = Infinity; + while (length--) { + if (arr[length] < min) { + min = arr[length]; + } + } + return min; +} -```javascript -var a = {}, - b = { key: "b" }, - c = { key: "c" }; +function findMax(arr) { + var length = arr.length + var max = -Infinity; + while (length--) { + if (arr[length] > max) { + max = arr[length]; + } + } + return max; +} -a[b] = 123; -a[c] = 456; -console.log(a[b]); +console.log(findMin(marks)); +console.log(findMax(marks)); ``` -## Q. ***Predict the output of the following JavaScript code?*** + + +## Q. Check if object is empty or not using javaScript? + +
Answer ```javascript -console.log( - (function f(n) { - return n > 1 ? n * f(n - 1) : n; - })(10) -); +function isEmpty(obj) { + return Object.keys(obj).length === 0; +} + +const obj = {}; +console.log(isEmpty(obj)); ``` -## Q. ***Predict the output of the following JavaScript code?*** +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-isempty-b7n04b?file=/src/index.js)** -```javascript -(function (x) { - return (function (y) { - console.log(x); //1 - })(2); -})(1); -``` +
-## Q. ***Predict the output of the following JavaScript code?*** +## Q. JavaScript Regular Expression to validate Email + +
Answer ```javascript -var hero = { - _name: "John Doe", - getSecretIdentity: function () { - return this._name; - }, -}; -var stoleSecretIdentity = hero.getSecretIdentity; +function validateEmail(email) { + const re = /\S+@\S+\.\S+/; + return re.test(email); +} -console.log(stoleSecretIdentity()); -console.log(hero.getSecretIdentity()); +console.log(validateEmail("pradeep.vwa@gmail.com")); // true ``` -## Q. ***Predict the output of the following JavaScript code?*** +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-validateemail-wfopym?file=/src/index.js)** + +
+ + + +## Q. Use RegEx to test password strength in JavaScript? + +
Answer ```javascript -var length = 10; -function fn() { - console.log(this.length); -} +let newPassword = "Pq5*@a{J"; +const regularExpression = new RegExp( + "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})" +); -var obj = { - length: 5, - method: function (fn) { - fn(); - arguments[0](); - }, -}; +if (!regularExpression.test(newPassword)) { + alert("Password should contain atleast one number and one special character !"); +} else { + console.log("PASS"); +} -obj.method(fn, 1); +// Output +PASS ``` +| RegEx | Description | +| ---------------- |--------------| +| ^ | The password string will start this way | +| (?=.\*[a-z]) | The string must contain at least 1 lowercase alphabetical character | +| (?=.\*[A-Z]) | The string must contain at least 1 uppercase alphabetical character | +| (?=.\*[0-9]) | The string must contain at least 1 numeric character | +| (?=.[!@#\$%\^&]) | The string must contain at least one special character, but we are escaping reserved RegEx characters to avoid conflict | +| (?=.{8,}) | The string must be eight characters or longer | + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-password-strength-cxl8xy)** + +
+ -## Q. ***Predict the output of the following JavaScript code?*** +## Q. Remove array element based on object property? + +
Answer ```javascript -(function () { - try { - throw new Error(); - } catch (x) { - var x = 1, - y = 2; - console.log(x); - } - console.log(x); - console.log(y); -})(); +var myArray = [ + { field: "id", operator: "eq" }, + { field: "cStatus", operator: "eq" }, + { field: "money", operator: "eq" }, +]; + +myArray = myArray.filter(function (obj) { + return obj.field !== "money"; +}); + +Console.log(myArray); +``` + +Output + +```js +myArray = [ + {field: "id", operator: "eq"} + {field: "cStatus", operator: "eq"} +] ``` -## Q. ***Predict the output of the following JavaScript code?*** +
+ + + +## Q. Predict the output of the following JavaScript code? ```javascript -var x = 21; -var girl = function () { - console.log(x); - var x = 20; -}; -girl(); +console.log(+"meow"); ``` -## Q. ***Predict the output of the following JavaScript code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -console.log(1 < 2 < 3); -console.log(3 > 2 > 1); +var result; +for (var i = 5; i > 0; i--) { + result = result + i; +} +console.log(result); ``` -## Q. ***Predict the output of the following JavaScript code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -console.log(typeof typeof 1); +var a = 1.2; +console.log(typeof a); ``` -## Q. ***Predict the output of the following JavaScript code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -var b = 1; -function outer() { - var b = 2; - function inner() { - b++; - var b = 3; - console.log(b); - } - inner(); +var x = 10; +if (x) { + let x = 4; } -outer(); +console.log(x); ``` -## Q. ***Predict the output of the following JavaScript code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -x = 10; -console.log(x); -var x; +console.log(0.1 + 0.2 == 0.3); ``` -## Q. ***Predict the output of the following JavaScript code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -const arr = [1, 2]; -arr.push(3); +console.log(1 + -"1" + 2); ``` -## Q. ***Predict the output of the following JavaScript code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -var o = new F(); -o.constructor === F; +(function (x) { + return (function (y) { + console.log(x); + })(10); +})(20); ``` -## Q. ***Predict the output of the following JavaScript code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -let sum = (a, b) => { - a + b; +var num = 20; +var getNumber = function () { + console.log(num); + var num = 10; }; -console.log(sum(10, 20)); +getNumber(); ``` -## Q. ***Predict the output of the following JavaScript code?*** + + +## Q. Predict the output of the following JavaScript code? ```javascript -var arr = ["javascript", "typescript", "es6"]; +function f1() { + num = 10; +} +f1(); +console.log("window.num: " + window.num); +``` -var searchValue = (value) => { - return arr.filter((item) => { - return item.indexOf(value) > -1; - }); -}; +## Q. Predict the output of the following JavaScript code? -console.log(searchValue("script")); +```javascript +console.log("(null + undefined): " + (null + undefined)); ``` -## Q. ***Write a program that prints the numbers from 1 to 15. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”?*** +## Q. Predict the output of the following JavaScript code? -**Example:** +```javascript +(function () { + var a = (b = 3); +})(); -```js -Input: 15 -Output: -1 -2 -Fizz -4 -Buzz -Fizz -7 -8 -Fizz -Buzz -11 -Fizz -13 -14 -FizzBuzz +console.log("value of a : " + a); +console.log("value of b : " + b); ``` -
Answer - -**Solution - 01:** +## Q. Predict the output of the following JavaScript code? ```javascript -for (var i = 1; i <= 15; i++) { - if (i % 15 == 0) console.log("FizzBuzz"); - else if (i % 3 == 0) console.log("Fizz"); - else if (i % 5 == 0) console.log("Buzz"); - else console.log(i); +var y = 1; +if (function f() {}) { + y += typeof f; } +console.log(y); ``` -**Solution - 02:** +## Q. Predict the output of the following JavaScript code? ```javascript -for (var i = 1; i <= 15; i++) { - var f = i % 3 == 0, - b = i % 5 == 0; - console.log(f ? (b ? "FizzBuzz" : "Fizz") : b ? "Buzz" : i); +var k = 1; +if (1) { + eval(function foo() {}); + k += typeof foo; } +console.log(k); ``` -
- -## Q. ***What will be the output of the following code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -var output = (function (x) { - delete x; - return x; -})(0); +var k = 1; +if (1) { + function foo() {} + k += typeof foo; +} +console.log(k); +``` -console.log(output); +## Q. Predict the output of the following JavaScript code? + +```javascript +console.log("(-1 / 0): " + -1 / 0); +console.log("(1 / 0): " + 1 / 0); +console.log("(0 / 0): " + 0 / 0); +console.log("(0 / 1): " + 0 / 1); ``` -
Answer +## Q. Predict the output of the following JavaScript code? -The code above will output `0` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **local variable**. `delete` operator doesn't affect local variables. +```javascript +var a = 4; +var b = "5"; +var c = 6; -
+console.log("(a + b): " + (a + b)); +console.log("(a - b): " + (a - b)); +console.log("(a * b): " + a * b); +console.log("(a / b): " + a / b); +console.log("(a % b): " + (a % b)); +``` -## Q. ***What will be the output of the following code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -var x = 1; -var output = (function () { - delete x; - return x; -})(); - -console.log(output); +console.log("MAX : " + Math.max(10, 2, NaN)); +console.log("MAX : " + Math.max()); ``` -
Answer - -The code above will output `1` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **global variable** of type `number`. - -
- - - -## Q. ***What will be the output of the following code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -var x = { foo: 1 }; -var output = (function () { - delete x.foo; - return x.foo; +(function () { + var a = (b = 3); })(); -console.log(output); +console.log("a defined? " + (typeof a !== "undefined")); +console.log("b defined? " + (typeof b !== "undefined")); ``` -
Answer - -The code above will output `undefined` as output. `delete` operator is used to delete a property from an object. Here `x` is an object which has foo as a property and from a self-invoking function, we are deleting the `foo` property of object `x` and after deletion, we are trying to reference deleted property `foo` which result `undefined`. +## Q. Predict the output of the following JavaScript code? -
+```javascript +var myObject = { + foo: "bar", + func: function () { + var self = this; + console.log("outer func: this.foo = " + this.foo); + console.log("outer func: self.foo = " + self.foo); + (function () { + console.log("inner func: this.foo = " + this.foo); + console.log("inner func: self.foo = " + self.foo); + })(); + }, +}; +myObject.func(); +``` -## Q. ***What will be the output of the following code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -var Employee = { - company: "xyz", -}; -var emp1 = Object.create(Employee); -delete emp1.company; -console.log(emp1.company); +console.log(0.1 + 0.2); +console.log(0.1 + 0.2 == 0.3); ``` -
Answer - -The code above will output `xyz` as output. Here `emp1` object got company as **prototype** property. delete operator doesn't delete prototype property. - -`emp1` object doesn't have **company** as its own property. you can test it `console.log(emp1.hasOwnProperty('company')); //output : false` However, we can delete company property directly from `Employee` object using `delete Employee.company` or we can also delete from `emp1` object using `__proto__` property `delete emp1.__proto__.company`. - -
+## Q. Predict the output of the following JavaScript code? - +```javascript +(function () { + console.log(1); + setTimeout(function () { + console.log(2); + }, 1000); + setTimeout(function () { + console.log(3); + }, 0); + console.log(4); +})(); +``` -## Q. ***What will be the output of the following code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -var trees = ["xyz", "xxxx", "test", "ryan", "apple"]; -delete trees[3]; -console.log(trees.length); -``` +var arr1 = "john".split(""); +var arr2 = arr1.reverse(); +var arr3 = "jones".split(""); -
Answer +arr2.push(arr3); -The code above will output `5` as output. When we used `delete` operator for deleting an array element then, the array length is not affected by this. This holds even if you deleted all elements of an array using `delete` operator. +console.log("array 1: length=" + arr1.length + " last=" + arr1.slice(-1)); +console.log("array 2: length=" + arr2.length + " last=" + arr2.slice(-1)); +``` -So when delete operator removes an array element that deleted element is no longer present in the array. In place of value at deleted index `undefined x 1` in **chrome** and `undefined` is placed at the index. If you do `console.log(trees)` output `["xyz", "xxxx", "test", undefined × 1, "apple"]` in Chrome and in Firefox `["xyz", "xxxx", "test", undefined, "apple"]`. +## Q. Predict the output of the following JavaScript code? -
+```javascript +console.log(1 + "2" + "2"); +console.log(1 + +"2" + "2"); +console.log(1 + -"1" + "2"); +console.log(+"1" + "1" + "2"); +console.log("A" - "B" + "2"); +console.log("A" - "B" + 2); +``` -## Q. ***What will be the output of the following code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -var bar = true; -console.log(bar + 0); -console.log(bar + "xyz"); -console.log(bar + true); -console.log(bar + false); +for (var i = 0; i < 5; i++) { + setTimeout(function () { + console.log(i); + }, i * 1000); +} ``` -
Answer +## Q. Predict the output of the following JavaScript code? -The code above will output `1, "truexyz", 2, 1` as output. Here's a general guideline for the plus operator: +```javascript +for (var i = 0; i < 5; i++) { + (function (x) { + setTimeout(function () { + console.log(x); + }, x * 1000); + })(i); +} +//Output:- 0, 1, 2, 3, 4 +``` -- Number + Number -> Addition -- Boolean + Number -> Addition -- Boolean + Boolean -> Addition -- Number + String -> Concatenation -- String + Boolean -> Concatenation -- String + String -> Concatenation +## Q. Predict the output of the following JavaScript code? -
+```javascript +console.log("0 || 1 = " + (0 || 1)); +console.log("1 || 2 = " + (1 || 2)); +console.log("0 && 1 = " + (0 && 1)); +console.log("1 && 2 = " + (1 && 2)); +``` -## Q. ***What will be the output of the following code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -var z = 1, - y = (z = typeof y); -console.log(y); +console.log(false == "0"); +console.log(false === "0"); ``` -
Answer - -The code above will print string `"undefined"` as output. According to associativity rule operator with the same precedence are processed based on their associativity property of operator. Here associativity of the assignment operator is `Right to Left` so first `typeof y` will evaluate first which is string `"undefined"` and assigned to `z` and then `y` would be assigned the value of z. The overall sequence will look like that: +## Q. Predict the output of the following JavaScript code? ```javascript -var z; -z = 1; -var y; -z = typeof y; -y = z; -``` +var a = {}, + b = { key: "b" }, + c = { key: "c" }; -
+a[b] = 123; +a[c] = 456; +console.log(a[b]); +``` -## Q. ***What will be the output of the following code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -// NFE (Named Function Expression) -var foo = function bar() { - return 12; -}; -typeof bar(); +console.log( + (function f(n) { + return n > 1 ? n * f(n - 1) : n; + })(10) +); ``` -
Answer - -The output will be `Reference Error`. To fix the bug we can try to rewrite the code a little bit: - -**Sample 1:** +## Q. Predict the output of the following JavaScript code? ```javascript -var bar = function () { - return 12; -}; -typeof bar(); +(function (x) { + return (function (y) { + console.log(x); //1 + })(2); +})(1); ``` -or + -**Sample 2:** +## Q. Predict the output of the following JavaScript code? ```javascript -function bar() { - return 12; -} -typeof bar(); +var hero = { + _name: "John Doe", + getSecretIdentity: function () { + return this._name; + }, +}; +var stoleSecretIdentity = hero.getSecretIdentity; + +console.log(stoleSecretIdentity()); +console.log(hero.getSecretIdentity()); ``` -The function definition can have only one reference variable as a function name, In **sample 1** `bar` is reference variable which is pointing to `anonymous function` and in **sample 2** we have function statement and `bar` is the function name. +## Q. Predict the output of the following JavaScript code? ```javascript -var foo = function bar() { - // foo is visible here - // bar is visible here - console.log(typeof bar()); // Works here :) +var length = 10; +function fn() { + console.log(this.length); +} + +var obj = { + length: 5, + method: function (fn) { + fn(); + arguments[0](); + }, }; -// foo is visible here -// bar is undefined here -``` -
+obj.method(fn, 1); +``` -## Q. ***What is the output of the following?*** +## Q. Predict the output of the following JavaScript code? ```javascript -bar(); -(function abc() { - console.log("something"); +(function () { + try { + throw new Error(); + } catch (x) { + var x = 1, + y = 2; + console.log(x); + } + console.log(x); + console.log(y); })(); -function bar() { - console.log("bar got called"); -} ``` -
Answer +## Q. Predict the output of the following JavaScript code? -The output will be : +```javascript +var x = 21; +var girl = function () { + console.log(x); + var x = 20; +}; +girl(); +``` -```js -bar got called -something +## Q. Predict the output of the following JavaScript code? + +```javascript +console.log(1 < 2 < 3); +console.log(3 > 2 > 1); ``` -Since the function is called first and defined during parse time the JS engine will try to find any possible parse time definitions and start the execution loop which will mean function is called first even if the definition is post another function. +## Q. Predict the output of the following JavaScript code? -
+```javascript +console.log(typeof typeof 1); +``` + +## Q. Predict the output of the following JavaScript code? + +```javascript +var b = 1; +function outer() { + var b = 2; + function inner() { + b++; + var b = 3; + console.log(b); + } + inner(); +} +outer(); +``` -## Q. ***What will be the output of the following code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -var salary = "1000$"; - -(function () { - console.log("Original salary was " + salary); - - var salary = "5000$"; - - console.log("My New Salary " + salary); -})(); +x = 10; +console.log(x); +var x; ``` -
Answer - -The code above will output: `undefined, 5000$` because of hoisting. In the code presented above, you might be expecting `salary` to retain it values from outer scope until the point that `salary` was re-declared in the inner scope. But due to `hoisting` salary value was `undefined` instead. To understand it better have a look of the following code, here `salary` variable is hoisted and declared at the top in function scope. When we print its value using `console.log` the result is `undefined`. Afterwards the variable is redeclared and the new value `"5000$"` is assigned to it. +## Q. Predict the output of the following JavaScript code? ```javascript -var salary = "1000$"; - -(function () { - var salary = undefined; - console.log("Original salary was " + salary); +const arr = [1, 2]; +arr.push(3); +``` - salary = "5000$"; +## Q. Predict the output of the following JavaScript code? - console.log("My New Salary " + salary); -})(); +```javascript +var o = new F(); +o.constructor === F; ``` -
- -## Q. ***What would be the output of the following code?*** +## Q. Predict the output of the following JavaScript code? ```javascript -function User(name) { - this.name = name || "JsGeeks"; -} +let sum = (a, b) => { + a + b; +}; +console.log(sum(10, 20)); +``` -var person = (new User("xyz")["location"] = "USA"); -console.log(person); +## Q. Predict the output of the following JavaScript code? + +```javascript +var arr = ["javascript", "typescript", "es6"]; + +var searchValue = (value) => { + return arr.filter((item) => { + return item.indexOf(value) > -1; + }); +}; + +console.log(searchValue("script")); ``` -
Answer +## Q. Write a program that prints the numbers from 1 to 15. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”? -The output of above code would be `"USA"`. Here `new User("xyz")` creates a brand new object and created property `location` on that and `USA` has been assigned to object property location and that has been referenced by the person. +**Example:** -Let say `new User("xyz")` created a object called `foo`. The value `"USA"` will be assigned to `foo["location"]`, but according to [ECMAScript Specification](http://www.ecma-international.org/ecma-262/6.0/#sec-assignment-operators-runtime-semantics-evaluation) , pt 12.14.4 the assignment will itself return the rightmost value: in our case it's `"USA"`. -Then it will be assigned to person. +```js +Input: 15 +Output: +1 +2 +Fizz +4 +Buzz +Fizz +7 +8 +Fizz +Buzz +11 +Fizz +13 +14 +FizzBuzz +``` -To better understand What is going on here, try to execute this code in console, line by line: +
Answer + +**Solution - 01:** ```javascript -function User(name) { - this.name = name || "JS"; +for (var i = 1; i <= 15; i++) { + if (i % 15 == 0) console.log("FizzBuzz"); + else if (i % 3 == 0) console.log("Fizz"); + else if (i % 5 == 0) console.log("Buzz"); + else console.log(i); } +``` -var person; -var foo = new User("xyz"); -foo["location"] = "USA"; -// the console will show you that the result of this is "USA" +**Solution - 02:** + +```javascript +for (var i = 1; i <= 15; i++) { + var f = i % 3 == 0, + b = i % 5 == 0; + console.log(f ? (b ? "FizzBuzz" : "Fizz") : b ? "Buzz" : i); +} ```
@@ -1197,19 +1355,20 @@ foo["location"] = "USA"; ↥ back to top
-## Q. ***What would be the output of following code?*** +## Q. What will be the output of the following code? ```javascript -var strA = "hi there"; -var strB = strA; -strB = "bye there!"; -console.log(strA); +var output = (function (x) { + delete x; + return x; +})(0); + +console.log(output); ```
Answer -The output will `'hi there'` because we're dealing with strings here. Strings are -passed by value, that is, copied. +The code above will output `0` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **local variable**. `delete` operator doesn't affect local variables.
@@ -1217,19 +1376,21 @@ passed by value, that is, copied. ↥ back to top
-## Q. ***What would be the output of following code?*** +## Q. What will be the output of the following code? ```javascript -var objA = { prop1: 42 }; -var objB = objA; -objB.prop1 = 90; -console.log(objA); +var x = 1; +var output = (function () { + delete x; + return x; +})(); + +console.log(output); ```
Answer -The output will `{prop1: 90}` because we're dealing with objects here. Objects are -passed by reference, that is, `objA` and `objB` point to the same object in memory. +The code above will output `1` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **global variable** of type `number`.
@@ -1237,24 +1398,21 @@ passed by reference, that is, `objA` and `objB` point to the same object in memo ↥ back to top
-## Q. ***What would be the output of following code?*** +## Q. What will be the output of the following code? ```javascript -var objA = { prop1: 42 }; -var objB = objA; -objB = {}; -console.log(objA); +var x = { foo: 1 }; +var output = (function () { + delete x.foo; + return x.foo; +})(); + +console.log(output); ```
Answer -The output will `{prop1: 42}`. - -When we assign `objA` to `objB`, the `objB` variable will point -to the same object as the `objB` variable. - -However, when we reassign `objB` to an empty object, we simply change where `objB` variable references to. -This doesn\'t affect where `objA` variable references to. +The code above will output `undefined` as output. `delete` operator is used to delete a property from an object. Here `x` is an object which has foo as a property and from a self-invoking function, we are deleting the `foo` property of object `x` and after deletion, we are trying to reference deleted property `foo` which result `undefined`.
@@ -1262,2176 +1420,2070 @@ This doesn\'t affect where `objA` variable references to. ↥ back to top
-## Q. ***What would be the output of following code?*** +## Q. What will be the output of the following code? ```javascript -var arrA = [0, 1, 2, 3, 4, 5]; -var arrB = arrA; -arrB[0] = 42; -console.log(arrA); +var Employee = { + company: "xyz", +}; +var emp1 = Object.create(Employee); +delete emp1.company; +console.log(emp1.company); ``` -The output will be `[42,1,2,3,4,5]`. - -Arrays are object in JavaScript and they are passed and assigned by reference. This is why -both `arrA` and `arrB` point to the same array `[0,1,2,3,4,5]`. That's why changing the first -element of the `arrB` will also modify `arrA`: it's the same array in the memory. - -## Q. ***What would be the output of following code?*** +
Answer -```javascript -var arrA = [0, 1, 2, 3, 4, 5]; -var arrB = arrA.slice(); -arrB[0] = 42; -console.log(arrA); -``` +The code above will output `xyz` as output. Here `emp1` object got company as **prototype** property. delete operator doesn't delete prototype property. -The output will be `[0,1,2,3,4,5]`. +`emp1` object doesn't have **company** as its own property. you can test it `console.log(emp1.hasOwnProperty('company')); //output : false` However, we can delete company property directly from `Employee` object using `delete Employee.company` or we can also delete from `emp1` object using `__proto__` property `delete emp1.__proto__.company`. -The `slice` function copies all the elements of the array returning the new array. That's why -`arrA` and `arrB` reference two completely different arrays. +
-## Q. ***What would be the output of following code?*** +## Q. What will be the output of the following code? ```javascript -var arrA = [ - { prop1: "value of array A!!" }, - { someProp: "also value of array A!" }, - 3, - 4, - 5, -]; -var arrB = arrA; -arrB[0].prop1 = 42; -console.log(arrA); +var trees = ["xyz", "xxxx", "test", "ryan", "apple"]; +delete trees[3]; +console.log(trees.length); ``` -The output will be `[{prop1: 42}, {someProp: "also value of array A!"}, 3,4,5]`. +
Answer -Arrays are object in JS, so both varaibles arrA and arrB point to the same array. Changing -`arrB[0]` is the same as changing `arrA[0]` +The code above will output `5` as output. When we used `delete` operator for deleting an array element then, the array length is not affected by this. This holds even if you deleted all elements of an array using `delete` operator. -## Q. ***What would be the output of following code?*** +So when delete operator removes an array element that deleted element is no longer present in the array. In place of value at deleted index `undefined x 1` in **chrome** and `undefined` is placed at the index. If you do `console.log(trees)` output `["xyz", "xxxx", "test", undefined × 1, "apple"]` in Chrome and in Firefox `["xyz", "xxxx", "test", undefined, "apple"]`. -```javascript -var arrA = [ - { prop1: "value of array A!!" }, - { someProp: "also value of array A!" }, - 3, - 4, - 5, -]; -var arrB = arrA.slice(); -arrB[0].prop1 = 42; -arrB[3] = 20; -console.log(arrA); -``` +
-The output will be `[{prop1: 42}, {someProp: "also value of array A!"}, 3,4,5]`. + -The `slice` function copies all the elements of the array returning the new array. However, -it doesn't do deep copying. Instead it does shallow copying. You can imagine slice implemented like this: +## Q. What will be the output of the following code? ```javascript -function slice(arr) { - var result = []; - for (i = 0; i < arr.length; i++) { - result.push(arr[i]); - } - return result; -} +var bar = true; +console.log(bar + 0); +console.log(bar + "xyz"); +console.log(bar + true); +console.log(bar + false); ``` -Look at the line with `result.push(arr[i])`. If `arr[i]` happens to be a number or string, -it will be passed by value, in other words, copied. If `arr[i]` is an object, it will be passed by reference. +
Answer -In case of our array `arr[0]` is an object `{prop1: "value of array A!!"}`. Only the reference -to this object will be copied. This effectively means that arrays arrA and arrB share first -two elements. +The code above will output `1, "truexyz", 2, 1` as output. Here's a general guideline for the plus operator: -This is why changing the property of `arrB[0]` in `arrB` will also change the `arrA[0]`. +- Number + Number -> Addition +- Boolean + Number -> Addition +- Boolean + Boolean -> Addition +- Number + String -> Concatenation +- String + Boolean -> Concatenation +- String + String -> Concatenation + +
-## Q. ***console.log(employeeId);*** +## Q. What will be the output of the following code? -1. Some Value -2. Undefined -3. Type Error -4. ReferenceError: employeeId is not defined +```javascript +var z = 1, + y = (z = typeof y); +console.log(y); +``` -_Answer:_ 4) ReferenceError: employeeId is not defined +
Answer -## Q. ***What would be the output of following code?*** +The code above will print string `"undefined"` as output. According to associativity rule operator with the same precedence are processed based on their associativity property of operator. Here associativity of the assignment operator is `Right to Left` so first `typeof y` will evaluate first which is string `"undefined"` and assigned to `z` and then `y` would be assigned the value of z. The overall sequence will look like that: ```javascript -console.log(employeeId); -var employeeId = "19000"; +var z; +z = 1; +var y; +z = typeof y; +y = z; ``` -1. Some Value -2. undefined -3. Type Error -4. ReferenceError: employeeId is not defined +
-_Answer:_ 2) undefined +## Q. What will be the output of the following code? + +```javascript +// NFE (Named Function Expression) +var foo = function bar() { + return 12; +}; +typeof bar(); +``` + +
Answer -## Q. ***What would be the output of following code?*** +The output will be `Reference Error`. To fix the bug we can try to rewrite the code a little bit: + +**Sample 1:** ```javascript -var employeeId = "1234abe"; -(function () { - console.log(employeeId); - var employeeId = "122345"; -})(); +var bar = function () { + return 12; +}; +typeof bar(); ``` -1. '122345' -2. undefined -3. Type Error -4. ReferenceError: employeeId is not defined +or -_Answer:_ 2) undefined +**Sample 2:** + +```javascript +function bar() { + return 12; +} +typeof bar(); +``` + +The function definition can have only one reference variable as a function name, In **sample 1** `bar` is reference variable which is pointing to `anonymous function` and in **sample 2** we have function statement and `bar` is the function name. + +```javascript +var foo = function bar() { + // foo is visible here + // bar is visible here + console.log(typeof bar()); // Works here :) +}; +// foo is visible here +// bar is undefined here +``` + +
-## Q. ***What would be the output of following code?*** +## Q. What is the output of the following? ```javascript -var employeeId = "1234abe"; -(function () { - console.log(employeeId); - var employeeId = "122345"; - (function () { - var employeeId = "abc1234"; - })(); +bar(); +(function abc() { + console.log("something"); })(); +function bar() { + console.log("bar got called"); +} ``` -1. '122345' -2. undefined -3. '1234abe' -4. ReferenceError: employeeId is not defined - -_Answer:_ 2) undefined +
Answer -## Q. ***What would be the output of following code?*** +The output will be : -```javascript -(function () { - console.log(typeof displayFunc); - var displayFunc = function () { - console.log("Hi I am inside displayFunc"); - }; -})(); +```js +bar got called +something ``` -1. undefined -2. function -3. 'Hi I am inside displayFunc' -4. ReferenceError: displayFunc is not defined +Since the function is called first and defined during parse time the JS engine will try to find any possible parse time definitions and start the execution loop which will mean function is called first even if the definition is post another function. -_Answer:_ 1) undefined +
-## Q. ***What would be the output of following code?*** +## Q. What will be the output of the following code? ```javascript -var employeeId = "abc123"; -function foo() { - employeeId = "123bcd"; - return; -} -foo(); -console.log(employeeId); -``` +var salary = "1000$"; + +(function () { + console.log("Original salary was " + salary); + + var salary = "5000$"; -1. undefined -2. '123bcd' -3. 'abc123' -4. ReferenceError: employeeId is not defined + console.log("My New Salary " + salary); +})(); +``` -_Answer:_ 2) '123bcd' +
Answer -## Q. ***What would be the output of following code?*** +The code above will output: `undefined, 5000$` because of hoisting. In the code presented above, you might be expecting `salary` to retain it values from outer scope until the point that `salary` was re-declared in the inner scope. But due to `hoisting` salary value was `undefined` instead. To understand it better have a look of the following code, here `salary` variable is hoisted and declared at the top in function scope. When we print its value using `console.log` the result is `undefined`. Afterwards the variable is redeclared and the new value `"5000$"` is assigned to it. ```javascript -var employeeId = "abc123"; +var salary = "1000$"; -function foo() { - employeeId = "123bcd"; - return; +(function () { + var salary = undefined; + console.log("Original salary was " + salary); - function employeeId() {} -} -foo(); -console.log(employeeId); -``` + salary = "5000$"; -1. undefined -2. '123bcd' -3. 'abc123' -4. ReferenceError: employeeId is not defined + console.log("My New Salary " + salary); +})(); +``` -_Answer:_ 3) 'abc123' +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of the following code? ```javascript -var employeeId = "abc123"; - -function foo() { - employeeId(); - return; - - function employeeId() { - console.log(typeof employeeId); - } +function User(name) { + this.name = name || "JsGeeks"; } -foo(); + +var person = (new User("xyz")["location"] = "USA"); +console.log(person); ``` -1. undefined -2. function -3. string -4. ReferenceError: employeeId is not defined +
Answer -_Answer:_ 2) 'function' +The output of above code would be `"USA"`. Here `new User("xyz")` creates a brand new object and created property `location` on that and `USA` has been assigned to object property location and that has been referenced by the person. -## Q. ***What would be the output of following code?*** +Let say `new User("xyz")` created a object called `foo`. The value `"USA"` will be assigned to `foo["location"]`, but according to [ECMAScript Specification](http://www.ecma-international.org/ecma-262/6.0/#sec-assignment-operators-runtime-semantics-evaluation) , pt 12.14.4 the assignment will itself return the rightmost value: in our case it's `"USA"`. +Then it will be assigned to person. -```javascript -function foo() { - employeeId(); - var product = "Car"; - return; +To better understand What is going on here, try to execute this code in console, line by line: - function employeeId() { - console.log(product); - } +```javascript +function User(name) { + this.name = name || "JS"; } -foo(); -``` -1. undefined -2. Type Error -3. 'Car' -4. ReferenceError: product is not defined +var person; +var foo = new User("xyz"); +foo["location"] = "USA"; +// the console will show you that the result of this is "USA" +``` -_Answer:_ 1) undefined +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -(function foo() { - bar(); - - function bar() { - abc(); - console.log(typeof abc); - } - - function abc() { - console.log(typeof bar); - } -})(); +var strA = "hi there"; +var strB = strA; +strB = "bye there!"; +console.log(strA); ``` -1. undefined undefined -2. Type Error -3. function function -4. ReferenceError: bar is not defined +
Answer + +The output will `'hi there'` because we're dealing with strings here. Strings are +passed by value, that is, copied. -_Answer:_ 3) function function +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -(function () { - "use strict"; - - var person = { - name: "John", - }; - person.salary = "10000$"; - person["country"] = "USA"; - - Object.defineProperty(person, "phoneNo", { - value: "8888888888", - enumerable: true, - }); - - console.log(Object.keys(person)); -})(); +var objA = { prop1: 42 }; +var objB = objA; +objB.prop1 = 90; +console.log(objA); ``` -1. Type Error -2. undefined -3. ["name", "salary", "country", "phoneNo"] -4. ["name", "salary", "country"] +
Answer + +The output will `{prop1: 90}` because we're dealing with objects here. Objects are +passed by reference, that is, `objA` and `objB` point to the same object in memory. -_Answer:_ 3) ["name", "salary", "country", "phoneNo"] +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -(function () { - "use strict"; +var objA = { prop1: 42 }; +var objB = objA; +objB = {}; +console.log(objA); +``` - var person = { - name: "John", - }; - person.salary = "10000$"; - person["country"] = "USA"; +
Answer - Object.defineProperty(person, "phoneNo", { - value: "8888888888", - enumerable: false, - }); +The output will `{prop1: 42}`. - console.log(Object.keys(person)); -})(); -``` +When we assign `objA` to `objB`, the `objB` variable will point +to the same object as the `objB` variable. -1. Type Error -2. undefined -3. ["name", "salary", "country", "phoneNo"] -4. ["name", "salary", "country"] +However, when we reassign `objB` to an empty object, we simply change where `objB` variable references to. +This doesn\'t affect where `objA` variable references to. -_Answer:_ 4) ["name", "salary", "country"] +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -(function () { - var objA = { - foo: "foo", - bar: "bar", - }; - var objB = { - foo: "foo", - bar: "bar", - }; - console.log(objA == objB); - console.log(objA === objB); -})(); +var arrA = [0, 1, 2, 3, 4, 5]; +var arrB = arrA; +arrB[0] = 42; +console.log(arrA); ``` -1. false true -2. false false -3. true false -4. true true - -_Answer:_ 2) false false - -## Q. ***What would be the output of following code?*** +
Answer -```javascript -(function () { - var objA = new Object({ foo: "foo" }); - var objB = new Object({ foo: "foo" }); - console.log(objA == objB); - console.log(objA === objB); -})(); -``` +The output will be `[42,1,2,3,4,5]`. -1. false true -2. false false -3. true false -4. true true +Arrays are object in JavaScript and they are passed and assigned by reference. This is why +both `arrA` and `arrB` point to the same array `[0,1,2,3,4,5]`. That's why changing the first +element of the `arrB` will also modify `arrA`: it's the same array in the memory. -_Answer:_ 2) false false +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -(function () { - var objA = Object.create({ - foo: "foo", - }); - var objB = Object.create({ - foo: "foo", - }); - console.log(objA == objB); - console.log(objA === objB); -})(); +var arrA = [0, 1, 2, 3, 4, 5]; +var arrB = arrA.slice(); +arrB[0] = 42; +console.log(arrA); ``` -1. false true -2. false false -3. true false -4. true true - -_Answer:_ 2) false false - -## Q. ***What would be the output of following code?*** +
Answer -```javascript -(function () { - var objA = Object.create({ - foo: "foo", - }); - var objB = Object.create(objA); - console.log(objA == objB); - console.log(objA === objB); -})(); -``` +The output will be `[0,1,2,3,4,5]`. -1. false true -2. false false -3. true false -4. true true +The `slice` function copies all the elements of the array returning the new array. That's why +`arrA` and `arrB` reference two completely different arrays. -_Answer:_ 2) false false +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -(function () { - var objA = Object.create({ - foo: "foo", - }); - var objB = Object.create(objA); - console.log(objA.toString() == objB.toString()); - console.log(objA.toString() === objB.toString()); -})(); +var arrA = [ + { prop1: "value of array A!!" }, + { someProp: "also value of array A!" }, + 3, + 4, + 5, +]; +var arrB = arrA; +arrB[0].prop1 = 42; +console.log(arrA); ``` -1. false true -2. false false -3. true false -4. true true - -_Answer:_ 4) true true - -## Q. ***What would be the output of following code?*** +
Answer -```javascript -(function () { - var objA = Object.create({ - foo: "foo", - }); - var objB = objA; - console.log(objA == objB); - console.log(objA === objB); - console.log(objA.toString() == objB.toString()); - console.log(objA.toString() === objB.toString()); -})(); -``` +The output will be `[{prop1: 42}, {someProp: "also value of array A!"}, 3,4,5]`. -1. true true true false -2. true false true true -3. true true true true -4. true true false false +Arrays are object in JS, so both varaibles arrA and arrB point to the same array. Changing +`arrB[0]` is the same as changing `arrA[0]` -_Answer:_ 3) true true true true +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -(function () { - var objA = Object.create({ - foo: "foo", - }); - var objB = objA; - objB.foo = "bar"; - console.log(objA.foo); - console.log(objB.foo); -})(); +var arrA = [ + { prop1: "value of array A!!" }, + { someProp: "also value of array A!" }, + 3, + 4, + 5, +]; +var arrB = arrA.slice(); +arrB[0].prop1 = 42; +arrB[3] = 20; +console.log(arrA); ``` -1. foo bar -2. bar bar -3. foo foo -4. bar foo +
Answer -_Answer:_ 2) bar bar +The output will be `[{prop1: 42}, {someProp: "also value of array A!"}, 3,4,5]`. -## Q. ***What would be the output of following code?*** +The `slice` function copies all the elements of the array returning the new array. However, +it doesn't do deep copying. Instead it does shallow copying. You can imagine slice implemented like this: ```javascript -(function () { - var objA = Object.create({ - foo: "foo", - }); - var objB = objA; - objB.foo = "bar"; - - delete objA.foo; - console.log(objA.foo); - console.log(objB.foo); -})(); +function slice(arr) { + var result = []; + for (i = 0; i < arr.length; i++) { + result.push(arr[i]); + } + return result; +} ``` -1. foo bar -2. bar bar -3. foo foo -4. bar foo +Look at the line with `result.push(arr[i])`. If `arr[i]` happens to be a number or string, +it will be passed by value, in other words, copied. If `arr[i]` is an object, it will be passed by reference. + +In case of our array `arr[0]` is an object `{prop1: "value of array A!!"}`. Only the reference +to this object will be copied. This effectively means that arrays arrA and arrB share first +two elements. + +This is why changing the property of `arrB[0]` in `arrB` will also change the `arrA[0]`. -_Answer:_ 3) foo foo +
-## Q. ***What would be the output of following code?*** +## Q. console.log(employeeId); -```javascript -(function () { - var objA = { - foo: "foo", - }; - var objB = objA; - objB.foo = "bar"; +
Answer - delete objA.foo; - console.log(objA.foo); - console.log(objB.foo); -})(); -``` +_Answer:_ ReferenceError: employeeId is not defined -1. foo bar -2. undefined undefined -3. foo foo -4. undefined bar +
-_Answer:_ 2) undefined undefined + -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -(function () { - var array = new Array("100"); - console.log(array); - console.log(array.length); -})(); +console.log(employeeId); +var employeeId = "19000"; ``` -1. undefined undefined -2. [undefined × 100] 100 -3. ["100"] 1 -4. ReferenceError: array is not defined +
Answer + +_Answer:_ undefined -_Answer:_ 3) ["100"] 1 +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript +var employeeId = "1234abe"; (function () { - var array1 = []; - var array2 = new Array(100); - var array3 = new Array(["1", 2, "3", 4, 5.6]); - console.log(array1); - console.log(array2); - console.log(array3); - console.log(array3.length); + console.log(employeeId); + var employeeId = "122345"; })(); ``` -1. [] [] [Array[5]] 1 -2. [] [undefined × 100] Array[5] 1 -3. [] [] ['1',2,'3',4,5.6] 5 -4. [] [] [Array[5]] 5 +
Answer + +_Answer:_ 2) undefined + +
-_Answer:_ 1) [] [] [Array[5]] 1 + -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript +var employeeId = "1234abe"; (function () { - var array = new Array("a", "b", "c", "d", "e"); - array[10] = "f"; - delete array[10]; - console.log(array.length); + console.log(employeeId); + var employeeId = "122345"; + (function () { + var employeeId = "abc1234"; + })(); })(); ``` -1. 11 -2. 5 -3. 6 -4. undefined +
Answer + +```js +undefined +``` -_Answer:_ 1) 11 +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript (function () { - var animal = ["cow", "horse"]; - animal.push("cat"); - animal.push("dog", "rat", "goat"); - console.log(animal.length); + console.log(typeof displayFunc); + var displayFunc = function () { + console.log("Hi I am inside displayFunc"); + }; })(); ``` -1. 4 -2. 5 -3. 6 -4. undefined +
Answer + +_Answer:_ undefined + +
-_Answer:_ 3) 6 + -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -(function () { - var animal = ["cow", "horse"]; - animal.push("cat"); - animal.unshift("dog", "rat", "goat"); - console.log(animal); -})(); +var employeeId = "abc123"; +function foo() { + employeeId = "123bcd"; + return; +} +foo(); +console.log(employeeId); ``` -1. [ 'dog', 'rat', 'goat', 'cow', 'horse', 'cat' ] -2. [ 'cow', 'horse', 'cat', 'dog', 'rat', 'goat' ] -3. Type Error -4. undefined +
Answer + +_Answer:_ '123bcd' -_Answer:_ 1) [ 'dog', 'rat', 'goat', 'cow', 'horse', 'cat' ] +
-## Q. ***What would be the output of following code?*** - -```javascript -(function () { - var array = [1, 2, 3, 4, 5]; - console.log(array.indexOf(2)); - console.log([{ name: "John" }, { name: "John" }].indexOf({ name: "John" })); - console.log([[1], [2], [3], [4]].indexOf([3])); - console.log("abcdefgh".indexOf("e")); -})(); -``` -1. 1 -1 -1 4 -2. 1 0 -1 4 -3. 1 -1 -1 -1 -4. 1 undefined -1 4 +## Q. What would be the output of following code? -_Answer:_ 1) 1 -1 -1 4 +```javascript +var employeeId = "abc123"; -## Q. ***What would be the output of following code?*** +function foo() { + employeeId = "123bcd"; + return; -```javascript -(function () { - var array = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6]; - console.log(array.indexOf(2)); - console.log(array.indexOf(2, 3)); - console.log(array.indexOf(2, 10)); -})(); + function employeeId() {} +} +foo(); +console.log(employeeId); ``` -1. 1 -1 -1 -2. 1 6 -1 -3. 1 1 -1 -4. 1 undefined undefined +
Answer + +_Answer:_ 'abc123' -_Answer:_ 2) 1 6 -1 +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -(function () { - var numbers = [2, 3, 4, 8, 9, 11, 13, 12, 16]; - var even = numbers.filter(function (element, index) { - return element % 2 === 0; - }); - console.log(even); +var employeeId = "abc123"; - var containsDivisibleby3 = numbers.some(function (element, index) { - return element % 3 === 0; - }); +function foo() { + employeeId(); + return; - console.log(containsDivisibleby3); -})(); + function employeeId() { + console.log(typeof employeeId); + } +} +foo(); ``` -1. [ 2, 4, 8, 12, 16 ] [ 0, 3, 0, 0, 9, 0, 12] -2. [ 2, 4, 8, 12, 16 ] [ 3, 9, 12] -3. [ 2, 4, 8, 12, 16 ] true -4. [ 2, 4, 8, 12, 16 ] false +
Answer -_Answer:_ 3) [ 2, 4, 8, 12, 16 ] true +_Answer:_ 'function' + +
+ + -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -(function () { - var containers = [2, 0, false, "", "12", true]; - var containers = containers.filter(Boolean); - console.log(containers); - var containers = containers.filter(Number); - console.log(containers); - var containers = containers.filter(String); - console.log(containers); - var containers = containers.filter(Object); - console.log(containers); -})(); +function foo() { + employeeId(); + var product = "Car"; + return; + + function employeeId() { + console.log(product); + } +} +foo(); ``` -1. [ 2, '12', true ] - [ 2, '12', true ] - [ 2, '12', true ] - [ 2, '12', true ] -2. [false, true] - [ 2 ] - ['12'] - [ ] -3. [2,0,false,"", '12', true] - [2,0,false,"", '12', true] - [2,0,false,"", '12', true] - [2,0,false,"", '12', true] -4. [ 2, '12', true ] - [ 2, '12', true, false ] - [ 2, '12', true,false ] - [ 2, '12', true,false] +
Answer -_Answer:_ 1) [ 2, '12', true ] -[ 2, '12', true ] -[ 2, '12', true ] -[ 2, '12', true ] +_Answer:_ 1) undefined + +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -(function () { - var list = ["foo", "bar", "john", "ritz"]; - console.log(list.slice(1)); - console.log(list.slice(1, 3)); - console.log(list.slice()); - console.log(list.slice(2, 2)); - console.log(list); +(function foo() { + bar(); + + function bar() { + abc(); + console.log(typeof abc); + } + + function abc() { + console.log(typeof bar); + } })(); ``` -1. [ 'bar', 'john', 'ritz' ] - [ 'bar', 'john' ] - [ 'foo', 'bar', 'john', 'ritz' ] - [] - [ 'foo', 'bar', 'john', 'ritz' ] -2. [ 'bar', 'john', 'ritz' ] - [ 'bar', 'john','ritz ] - [ 'foo', 'bar', 'john', 'ritz' ] - [] - [ 'foo', 'bar', 'john', 'ritz' ] -3. [ 'john', 'ritz' ] - [ 'bar', 'john' ] - [ 'foo', 'bar', 'john', 'ritz' ] - [] - [ 'foo', 'bar', 'john', 'ritz' ] -4. [ 'foo' ] - [ 'bar', 'john' ] - [ 'foo', 'bar', 'john', 'ritz' ] - [] - [ 'foo', 'bar', 'john', 'ritz' ] +
Answer -_Answer:_ 1) [ 'bar', 'john', 'ritz' ] -[ 'bar', 'john' ] -[ 'foo', 'bar', 'john', 'ritz' ] -[] -[ 'foo', 'bar', 'john', 'ritz' ] +_Answer:_ function function -## Q. ***What would be the output of following code?*** +
+ + + +## Q. What would be the output of following code? ```javascript (function () { - var list = ["foo", "bar", "john"]; - console.log(list.splice(1)); - console.log(list.splice(1, 2)); - console.log(list); + "use strict"; + + var person = { + name: "John", + }; + person.salary = "10000$"; + person["country"] = "USA"; + + Object.defineProperty(person, "phoneNo", { + value: "8888888888", + enumerable: true, + }); + + console.log(Object.keys(person)); })(); ``` -1. [ 'bar', 'john' ] [] [ 'foo' ] -2. [ 'bar', 'john' ] [] [ 'bar', 'john' ] -3. [ 'bar', 'john' ] [ 'bar', 'john' ] [ 'bar', 'john' ] -4. [ 'bar', 'john' ] [] [] +
Answer -_Answer:_ 1. [ 'bar', 'john' ] [] [ 'foo' ] +_Answer:_ ["name", "salary", "country", "phoneNo"] + +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript (function () { - var arrayNumb = [2, 8, 15, 16, 23, 42]; - arrayNumb.sort(); - console.log(arrayNumb); + "use strict"; + + var person = { + name: "John", + }; + person.salary = "10000$"; + person["country"] = "USA"; + + Object.defineProperty(person, "phoneNo", { + value: "8888888888", + enumerable: false, + }); + + console.log(Object.keys(person)); })(); ``` -1. [2, 8, 15, 16, 23, 42] -2. [42, 23, 26, 15, 8, 2] -3. [ 15, 16, 2, 23, 42, 8 ] -4. [ 2, 8, 15, 16, 23, 42 ] +
Answer -_Answer:_ 3. [ 15, 16, 2, 23, 42, 8 ] +_Answer:_ ["name", "salary", "country"] -## Q. ***What would be the output of following code?*** +
-```javascript -function funcA() { - console.log("funcA ", this); - (function innerFuncA1() { - console.log("innerFunc1", this); - (function innerFunA11() { - console.log("innerFunA11", this); - })(); - })(); -} + -console.log(funcA()); +## Q. What would be the output of following code? + +```javascript +(function () { + var objA = { + foo: "foo", + bar: "bar", + }; + var objB = { + foo: "foo", + bar: "bar", + }; + console.log(objA == objB); + console.log(objA === objB); +})(); ``` -1. funcA Window {...} - innerFunc1 Window {...} - innerFunA11 Window {...} -2. undefined -3. Type Error -4. ReferenceError: this is not defined +
Answer -_Answer:_ 1) +_Answer:_ 2) false false + +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -var obj = { - message: "Hello", - innerMessage: !(function () { - console.log(this.message); - })(), -}; - -console.log(obj.innerMessage); +(function () { + var objA = new Object({ foo: "foo" }); + var objB = new Object({ foo: "foo" }); + console.log(objA == objB); + console.log(objA === objB); +})(); ``` -1. ReferenceError: this.message is not defined -2. undefined -3. Type Error -4. undefined true +
Answer -_Answer:_ 4) undefined true +_Answer:_ false false -## Q. ***What would be the output of following code?*** +
-```javascript -var obj = { - message: "Hello", - innerMessage: function () { - return this.message; - }, -}; + -console.log(obj.innerMessage()); +## Q. What would be the output of following code? + +```javascript +(function () { + var objA = Object.create({ + foo: "foo", + }); + var objB = Object.create({ + foo: "foo", + }); + console.log(objA == objB); + console.log(objA === objB); +})(); ``` -1. Hello -2. undefined -3. Type Error -4. ReferenceError: this.message is not defined +
Answer -_Answer:_ 1) Hello +_Answer:_ 2) false false + +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -var obj = { - message: "Hello", - innerMessage: function () { - (function () { - console.log(this.message); - })(); - }, -}; -console.log(obj.innerMessage()); +(function () { + var objA = Object.create({ + foo: "foo", + }); + var objB = Object.create(objA); + console.log(objA == objB); + console.log(objA === objB); +})(); ``` -1. Type Error -2. Hello -3. undefined -4. ReferenceError: this.message is not defined +
Answer -_Answer:_ 3) undefined +_Answer:_ 2) false false + +
+ + -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -var obj = { - message: "Hello", - innerMessage: function () { - var self = this; - (function () { - console.log(self.message); - })(); - }, -}; -console.log(obj.innerMessage()); +(function () { + var objA = Object.create({ + foo: "foo", + }); + var objB = Object.create(objA); + console.log(objA.toString() == objB.toString()); + console.log(objA.toString() === objB.toString()); +})(); ``` -1. Type Error -2. 'Hello' -3. undefined -4. ReferenceError: self.message is not defined +
Answer -_Answer:_ 2) 'Hello' +_Answer:_ true true + +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -function myFunc() { - console.log(this.message); -} -myFunc.message = "Hi John"; - -console.log(myFunc()); +(function () { + var objA = Object.create({ + foo: "foo", + }); + var objB = objA; + console.log(objA == objB); + console.log(objA === objB); + console.log(objA.toString() == objB.toString()); + console.log(objA.toString() === objB.toString()); +})(); ``` -1. Type Error -2. 'Hi John' -3. undefined -4. ReferenceError: this.message is not defined +
Answer -_Answer:_ 3) undefined +_Answer:_ true true true true -## Q. ***What would be the output of following code?*** +
-```javascript -function myFunc() { - console.log(myFunc.message); -} -myFunc.message = "Hi John"; + -console.log(myFunc()); +## Q. What would be the output of following code? + +```javascript +(function () { + var objA = Object.create({ + foo: "foo", + }); + var objB = objA; + objB.foo = "bar"; + console.log(objA.foo); + console.log(objB.foo); +})(); ``` -1. Type Error -2. 'Hi John' -3. undefined -4. ReferenceError: this.message is not defined +
Answer -_Answer:_ 2) 'Hi John' +_Answer:_ bar bar + +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -function myFunc() { - myFunc.message = "Hi John"; - console.log(myFunc.message); -} -console.log(myFunc()); +(function () { + var objA = Object.create({ + foo: "foo", + }); + var objB = objA; + objB.foo = "bar"; + + delete objA.foo; + console.log(objA.foo); + console.log(objB.foo); +})(); ``` -1. Type Error -2. 'Hi John' -3. undefined -4. ReferenceError: this.message is not defined +
Answer -_Answer:_ 2) 'Hi John' +_Answer:_ foo foo + +
+ + -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -function myFunc(param1, param2) { - console.log(myFunc.length); -} -console.log(myFunc()); -console.log(myFunc("a", "b")); -console.log(myFunc("a", "b", "c", "d")); +(function () { + var objA = { + foo: "foo", + }; + var objB = objA; + objB.foo = "bar"; + + delete objA.foo; + console.log(objA.foo); + console.log(objB.foo); +})(); ``` -1. 2 2 2 -2. 0 2 4 -3. undefined -4. ReferenceError +
Answer -_Answer:_ a) 2 2 2 +_Answer:_ undefined undefined + +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -function myFunc() { - console.log(arguments.length); -} -console.log(myFunc()); -console.log(myFunc("a", "b")); -console.log(myFunc("a", "b", "c", "d")); +(function () { + var array = new Array("100"); + console.log(array); + console.log(array.length); +})(); ``` -1. 2 2 2 -2. 0 2 4 -3. undefined -4. ReferenceError - -_Answer:_ 2) 0 2 4 - -## Q. ***What would be the output of following code?*** - -```javascript -function Person(name, age) { - this.name = name || "John"; - this.age = age || 24; - this.displayName = function () { - console.log(this.name); - }; -} - -Person.name = "John"; -Person.displayName = function () { - console.log(this.name); -}; - -var person1 = new Person("John"); -person1.displayName(); -Person.displayName(); -``` +
Answer -1. John Person -2. John John -3. John undefined -4. John John +_Answer:_ 3) ["100"] 1 -_Answer:_ 1) John Person +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -function passWordMngr() { - var password = "12345678"; - this.userName = "John"; - return { - pwd: password, - }; -} -// Block End -var userInfo = passWordMngr(); -console.log(userInfo.pwd); -console.log(userInfo.userName); +(function () { + var array1 = []; + var array2 = new Array(100); + var array3 = new Array(["1", 2, "3", 4, 5.6]); + console.log(array1); + console.log(array2); + console.log(array3); + console.log(array3.length); +})(); ``` -1. 12345678 Window -2. 12345678 John -3. 12345678 undefined -4. undefined undefined - -_Answer:_ 3) 12345678 undefined - -## Q. ***What would be the output of following code?*** - -```javascript -var employeeId = "aq123"; -function Employee() { - this.employeeId = "bq1uy"; -} -console.log(Employee.employeeId); -``` +
Answer -1. Reference Error -2. aq123 -3. bq1uy -4. undefined +_Answer:_ [] [] [Array[5]] 1 -_Answer:_ 4) undefined +
-## Q. ***What would be the output of following code?*** - -```javascript -var employeeId = "aq123"; - -function Employee() { - this.employeeId = "bq1uy"; -} -console.log(new Employee().employeeId); -Employee.prototype.employeeId = "kj182"; -Employee.prototype.JobId = "1BJKSJ"; -console.log(new Employee().JobId); -console.log(new Employee().employeeId); -``` - -1. bq1uy 1BJKSJ bq1uy undefined -2. bq1uy 1BJKSJ bq1uy -3. bq1uy 1BJKSJ kj182 -4. undefined 1BJKSJ kj182 - -_Answer:_ 2) bq1uy 1BJKSJ bq1uy - -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -var employeeId = "aq123"; -(function Employee() { - try { - throw "foo123"; - } catch (employeeId) { - console.log(employeeId); - } - console.log(employeeId); +(function () { + var array = new Array("a", "b", "c", "d", "e"); + array[10] = "f"; + delete array[10]; + console.log(array.length); })(); ``` -1. foo123 aq123 -2. foo123 foo123 -3. aq123 aq123 -4. foo123 undefined +
Answer -_Answer:_ 1) foo123 aq123 +_Answer:_ 11 + +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript (function () { - var greet = "Hello World"; - var toGreet = [].filter.call(greet, function (element, index) { - return index > 5; - }); - console.log(toGreet); + var animal = ["cow", "horse"]; + animal.push("cat"); + animal.push("dog", "rat", "goat"); + console.log(animal.length); })(); ``` -1. Hello World -2. undefined -3. World -4. [ 'W', 'o', 'r', 'l', 'd' ] +
Answer -_Answer:_ 4) [ 'W', 'o', 'r', 'l', 'd' ] +_Answer:_ 6 + +
+ + -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript (function () { - var fooAccount = { - name: "John", - amount: 4000, - deductAmount: function (amount) { - this.amount -= amount; - return "Total amount left in account: " + this.amount; - }, - }; - var barAccount = { - name: "John", - amount: 6000, - }; - var withdrawAmountBy = function (totalAmount) { - return fooAccount.deductAmount.bind(barAccount, totalAmount); - }; - console.log(withdrawAmountBy(400)()); - console.log(withdrawAmountBy(300)()); + var animal = ["cow", "horse"]; + animal.push("cat"); + animal.unshift("dog", "rat", "goat"); + console.log(animal); })(); ``` -1. Total amount left in account: 5600 Total amount left in account: 5300 -2. undefined undefined -3. Total amount left in account: 3600 Total amount left in account: 3300 -4. Total amount left in account: 5600 Total amount left in account: 5600 +
Answer -_Answer:_ 1) Total amount left in account: 5600 Total amount left in account: 5300 +_Answer:_ [ 'dog', 'rat', 'goat', 'cow', 'horse', 'cat' ] + +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript (function () { - var fooAccount = { - name: "John", - amount: 4000, - deductAmount: function (amount) { - this.amount -= amount; - return this.amount; - }, - }; - var barAccount = { - name: "John", - amount: 6000, - }; - var withdrawAmountBy = function (totalAmount) { - return fooAccount.deductAmount.apply(barAccount, [totalAmount]); - }; - console.log(withdrawAmountBy(400)); - console.log(withdrawAmountBy(300)); - console.log(withdrawAmountBy(200)); + var array = [1, 2, 3, 4, 5]; + console.log(array.indexOf(2)); + console.log([{ name: "John" }, { name: "John" }].indexOf({ name: "John" })); + console.log([[1], [2], [3], [4]].indexOf([3])); + console.log("abcdefgh".indexOf("e")); })(); ``` -1. 5600 5300 5100 -2. 3600 3300 3100 -3. 5600 3300 5100 -4. undefined undefined undefined +
Answer -_Answer:_ 1) 5600 5300 5100 +_Answer:_ 1) 1 -1 -1 4 + +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript (function () { - var fooAccount = { - name: "John", - amount: 6000, - deductAmount: function (amount) { - this.amount -= amount; - return this.amount; - }, - }; - var barAccount = { - name: "John", - amount: 4000, - }; - var withdrawAmountBy = function (totalAmount) { - return fooAccount.deductAmount.call(barAccount, totalAmount); - }; - console.log(withdrawAmountBy(400)); - console.log(withdrawAmountBy(300)); - console.log(withdrawAmountBy(200)); + var array = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6]; + console.log(array.indexOf(2)); + console.log(array.indexOf(2, 3)); + console.log(array.indexOf(2, 10)); })(); ``` -1. 5600 5300 5100 -2. 3600 3300 3100 -3. 5600 3300 5100 -4. undefined undefined undefined +
Answer -_Answer:_ 2) 3600 3300 3100 +_Answer:_ 1 6 -1 + +
-## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -(function greetNewCustomer() { - console.log("Hello " + this.name); -}.bind({ - name: "John", -})()); -``` +(function () { + var numbers = [2, 3, 4, 8, 9, 11, 13, 12, 16]; + var even = numbers.filter(function (element, index) { + return element % 2 === 0; + }); + console.log(even); -1. Hello John -2. Reference Error -3. Window -4. undefined + var containsDivisibleby3 = numbers.some(function (element, index) { + return element % 3 === 0; + }); -_Answer:_ 1) Hello John + console.log(containsDivisibleby3); +})(); +``` -## Q. ***What would be the output of following code?*** +1. [ 2, 4, 8, 12, 16 ] [ 0, 3, 0, 0, 9, 0, 12] +2. [ 2, 4, 8, 12, 16 ] [ 3, 9, 12] +3. [ 2, 4, 8, 12, 16 ] true +4. [ 2, 4, 8, 12, 16 ] false -```javascript -function getDataFromServer(apiUrl) { - var name = "John"; - return { - then: function (fn) { - fn(name); - }, - }; -} +_Answer:_ 3) [ 2, 4, 8, 12, 16 ] true -getDataFromServer("www.google.com").then(function (name) { - console.log(name); -}); +## Q. What would be the output of following code? + +```javascript +(function () { + var containers = [2, 0, false, "", "12", true]; + var containers = containers.filter(Boolean); + console.log(containers); + var containers = containers.filter(Number); + console.log(containers); + var containers = containers.filter(String); + console.log(containers); + var containers = containers.filter(Object); + console.log(containers); +})(); ``` -1. John -2. undefined -3. Reference Error -4. fn is not defined +1. [ 2, '12', true ] + [ 2, '12', true ] + [ 2, '12', true ] + [ 2, '12', true ] +2. [false, true] + [ 2 ] + ['12'] + [ ] +3. [2,0,false,"", '12', true] + [2,0,false,"", '12', true] + [2,0,false,"", '12', true] + [2,0,false,"", '12', true] +4. [ 2, '12', true ] + [ 2, '12', true, false ] + [ 2, '12', true,false ] + [ 2, '12', true,false] -_Answer:_ 1) John +_Answer:_ 1) [ 2, '12', true ] +[ 2, '12', true ] +[ 2, '12', true ] +[ 2, '12', true ] -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript (function () { - var arrayNumb = [2, 8, 15, 16, 23, 42]; - Array.prototype.sort = function (a, b) { - return a - b; - }; - arrayNumb.sort(); - console.log(arrayNumb); + var list = ["foo", "bar", "john", "ritz"]; + console.log(list.slice(1)); + console.log(list.slice(1, 3)); + console.log(list.slice()); + console.log(list.slice(2, 2)); + console.log(list); })(); +``` -(function () { - var numberArray = [2, 8, 15, 16, 23, 42]; - numberArray.sort(function (a, b) { - if (a == b) { - return 0; - } else { - return a < b ? -1 : 1; - } - }); - console.log(numberArray); -})(); +1. [ 'bar', 'john', 'ritz' ] + [ 'bar', 'john' ] + [ 'foo', 'bar', 'john', 'ritz' ] + [] + [ 'foo', 'bar', 'john', 'ritz' ] +2. [ 'bar', 'john', 'ritz' ] + [ 'bar', 'john','ritz ] + [ 'foo', 'bar', 'john', 'ritz' ] + [] + [ 'foo', 'bar', 'john', 'ritz' ] +3. [ 'john', 'ritz' ] + [ 'bar', 'john' ] + [ 'foo', 'bar', 'john', 'ritz' ] + [] + [ 'foo', 'bar', 'john', 'ritz' ] +4. [ 'foo' ] + [ 'bar', 'john' ] + [ 'foo', 'bar', 'john', 'ritz' ] + [] + [ 'foo', 'bar', 'john', 'ritz' ] + +_Answer:_ 1) [ 'bar', 'john', 'ritz' ] +[ 'bar', 'john' ] +[ 'foo', 'bar', 'john', 'ritz' ] +[] +[ 'foo', 'bar', 'john', 'ritz' ] + +## Q. What would be the output of following code? +```javascript (function () { - var numberArray = [2, 8, 15, 16, 23, 42]; - numberArray.sort(function (a, b) { - return a - b; - }); - console.log(numberArray); + var list = ["foo", "bar", "john"]; + console.log(list.splice(1)); + console.log(list.splice(1, 2)); + console.log(list); })(); ``` -1. [ 2, 8, 15, 16, 23, 42 ] - [ 2, 8, 15, 16, 23, 42 ] - [ 2, 8, 15, 16, 23, 42 ] -2. undefined undefined undefined -3. [42, 23, 16, 15, 8, 2] - [42, 23, 16, 15, 8, 2] - [42, 23, 16, 15, 8, 2] -4. Reference Error +1. [ 'bar', 'john' ] [] [ 'foo' ] +2. [ 'bar', 'john' ] [] [ 'bar', 'john' ] +3. [ 'bar', 'john' ] [ 'bar', 'john' ] [ 'bar', 'john' ] +4. [ 'bar', 'john' ] [] [] -_Answer:_ 1) [ 2, 8, 15, 16, 23, 42 ] -[ 2, 8, 15, 16, 23, 42 ] -[ 2, 8, 15, 16, 23, 42 ] +_Answer:_ 1. [ 'bar', 'john' ] [] [ 'foo' ] -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript (function () { - function sayHello() { - var name = "Hi John"; - return; - { - fullName: name; - } - } - console.log(sayHello().fullName); + var arrayNumb = [2, 8, 15, 16, 23, 42]; + arrayNumb.sort(); + console.log(arrayNumb); })(); ``` -1. Hi John -2. undefined -3. Reference Error -4. Uncaught TypeError: Cannot read property 'fullName' of undefined +1. [2, 8, 15, 16, 23, 42] +2. [42, 23, 26, 15, 8, 2] +3. [ 15, 16, 2, 23, 42, 8 ] +4. [ 2, 8, 15, 16, 23, 42 ] -_Answer:_ 4) Uncaught TypeError: Cannot read property 'fullName' of undefined +_Answer:_ 3. [ 15, 16, 2, 23, 42, 8 ] -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -function getNumber() { - return 2, 4, 5; +function funcA() { + console.log("funcA ", this); + (function innerFuncA1() { + console.log("innerFunc1", this); + (function innerFunA11() { + console.log("innerFunA11", this); + })(); + })(); } -var numb = getNumber(); -console.log(numb); +console.log(funcA()); ``` -1. 5 -2. undefined -3. 2 -4. (2,4,5) +1. funcA Window {...} + innerFunc1 Window {...} + innerFunA11 Window {...} +2. undefined +3. Type Error +4. ReferenceError: this is not defined -_Answer:_ 1) 5 +_Answer:_ 1) -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -function getNumber() { - return; -} +var obj = { + message: "Hello", + innerMessage: !(function () { + console.log(this.message); + })(), +}; -var numb = getNumber(); -console.log(numb); +console.log(obj.innerMessage); ``` -1. null -2. undefined -3. "" -4. 0 +1. ReferenceError: this.message is not defined +2. undefined +3. Type Error +4. undefined true -_Answer:_ 2) undefined +_Answer:_ 4) undefined true -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -function mul(x) { - return function (y) { - return [ - x * y, - function (z) { - return x * y + z; - }, - ]; - }; -} +var obj = { + message: "Hello", + innerMessage: function () { + return this.message; + }, +}; -console.log(mul(2)(3)[0]); -console.log(mul(2)(3)[1](4)); +console.log(obj.innerMessage()); ``` -1. 6, 10 -2. undefined undefined -3. Reference Error -4. 10, 6 +1. Hello +2. undefined +3. Type Error +4. ReferenceError: this.message is not defined -_Answer:_ 1) 6, 10 +_Answer:_ 1) Hello -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -function mul(x) { - return function (y) { - return { - result: x * y, - sum: function (z) { - return x * y + z; - }, - }; - }; -} -console.log(mul(2)(3).result); -console.log(mul(2)(3).sum(4)); +var obj = { + message: "Hello", + innerMessage: function () { + (function () { + console.log(this.message); + })(); + }, +}; +console.log(obj.innerMessage()); ``` -1. 6, 10 -2. undefined undefined -3. Reference Error -4. 10, 6 +1. Type Error +2. Hello +3. undefined +4. ReferenceError: this.message is not defined -_Answer:_ 1) 6, 10 +_Answer:_ 3) undefined -## Q. ***What would be the output of following code?*** +## Q. What would be the output of following code? ```javascript -function mul(x) { - return function (y) { - return function (z) { - return function (w) { - return function (p) { - return x * y * z * w * p; - }; - }; - }; - }; -} -console.log(mul(2)(3)(4)(5)(6)); +var obj = { + message: "Hello", + innerMessage: function () { + var self = this; + (function () { + console.log(self.message); + })(); + }, +}; +console.log(obj.innerMessage()); ``` -1. 720 -2. undefined -3. Reference Error -4. Type Error +1. Type Error +2. 'Hello' +3. undefined +4. ReferenceError: self.message is not defined -_Answer:_ 1) 720 +_Answer:_ 2) 'Hello' -## Q. ***What is the value of `foo`?*** +## Q. What would be the output of following code? ```javascript -var foo = 10 + "20"; -``` +function myFunc() { + console.log(this.message); +} +myFunc.message = "Hi John"; -_Answer:_ `'1020'`, because of type coercion from Number to String +console.log(myFunc()); +``` -## Q. ***How would you make this work?*** +1. Type Error +2. 'Hi John' +3. undefined +4. ReferenceError: this.message is not defined -```javascript -add(2, 5); // 7 -add(2)(5); // 7 -``` +_Answer:_ 3) undefined -_Answer:_ A general solution for any number of parameters +## Q. What would be the output of following code? ```javascript -"use strict"; +function myFunc() { + console.log(myFunc.message); +} +myFunc.message = "Hi John"; -let sum = (arr) => arr.reduce((a, b) => a + b); -let addGenerator = (numArgs, prevArgs) => { - return function () { - let totalArgs = prevArgs.concat(Array.from(arguments)); - if (totalArgs.length === numArgs) { - return sum(totalArgs); - } - return addGenerator(numArgs, totalArgs); - }; -}; +console.log(myFunc()); +``` -let add = addGenerator(2, []); +1. Type Error +2. 'Hi John' +3. undefined +4. ReferenceError: this.message is not defined -add(2, 5); // 7 -add(2)(5); // 7 -add()(2, 5); // 7 -add()(2)(5); // 7 -add()()(2)(5); // 7 -``` +_Answer:_ 2) 'Hi John' -## Q. ***What value is returned from the following statement?*** +## Q. What would be the output of following code? ```javascript -"i'm a lasagna hog".split("").reverse().join(""); +function myFunc() { + myFunc.message = "Hi John"; + console.log(myFunc.message); +} +console.log(myFunc()); ``` -_Answer:_ It's actually a reverse method for a string - `'goh angasal a m\'i'` - -## Q. ***What is the value of `window.foo`?*** - -```javascript -window.foo || (window.foo = "bar"); -``` +1. Type Error +2. 'Hi John' +3. undefined +4. ReferenceError: this.message is not defined -_Answer:_ Always `'bar'` +_Answer:_ 2) 'Hi John' -## Q. ***What is the outcome of the two alerts below?*** +## Q. What would be the output of following code? ```javascript -var foo = "Hello"; -(function () { - var bar = " World"; - alert(foo + bar); -})(); -alert(foo + bar); +function myFunc(param1, param2) { + console.log(myFunc.length); +} +console.log(myFunc()); +console.log(myFunc("a", "b")); +console.log(myFunc("a", "b", "c", "d")); ``` -_Answer:_ +1. 2 2 2 +2. 0 2 4 +3. undefined +4. ReferenceError -- First: `Hello World` -- Second: Throws an exception, `ReferenceError: bar is not defined` +_Answer:_ a) 2 2 2 -## Q. ***What is the value of `foo.length`?*** +## Q. What would be the output of following code? ```javascript -var foo = []; -foo.push(1); -foo.push(2); +function myFunc() { + console.log(arguments.length); +} +console.log(myFunc()); +console.log(myFunc("a", "b")); +console.log(myFunc("a", "b", "c", "d")); ``` -_Answer:_ `.push` is mutable - `2` +1. 2 2 2 +2. 0 2 4 +3. undefined +4. ReferenceError -## Q. ***What is the value of `foo.x`?*** +_Answer:_ 2) 0 2 4 + +## Q. What would be the output of following code? ```javascript -var foo = { n: 1 }; -var bar = foo; -foo.x = foo = { n: 2 }; +function Person(name, age) { + this.name = name || "John"; + this.age = age || 24; + this.displayName = function () { + console.log(this.name); + }; +} + +Person.name = "John"; +Person.displayName = function () { + console.log(this.name); +}; + +var person1 = new Person("John"); +person1.displayName(); +Person.displayName(); ``` -_Answer:_ `undefined`. Rather, `bar.x` is `{n: 2}`. +1. John Person +2. John John +3. John undefined +4. John John -`foo.x = foo = {n: 2}` is the same as `foo.x = (foo = {n: 2})`. It is because -a left term is first referenced and then a right term is evaluated when an -assignment is performed in JavaScript. When `foo.x` is referenced, it refers -to an original object, `{n: 1}`. So, when the result of the right term, `{n: 2}`, is evaluated, it will assigned to the original object, which is at the -moment referenced by `bar`. +_Answer:_ 1) John Person -## Q. ***What does the following code print?*** +## Q. What would be the output of following code? ```javascript -console.log("one"); -setTimeout(function () { - console.log("two"); -}, 0); -console.log("three"); +function passWordMngr() { + var password = "12345678"; + this.userName = "John"; + return { + pwd: password, + }; +} +// Block End +var userInfo = passWordMngr(); +console.log(userInfo.pwd); +console.log(userInfo.userName); ``` -_Answer:_ `one`, `three` and `two`. It's because `console.log('two');` will be -invoked in the next event loop. - -## Q. ***What would be the result of 1+2+'3'?*** +1. 12345678 Window +2. 12345678 John +3. 12345678 undefined +4. undefined undefined -The output is going to be `33`. Since `1` and `2` are numeric values, the result of first two digits is going to be a numeric value `3`. The next digit is a string type value because of that the addition of numeric value `3` and string type value `3` is just going to be a concatenation value `33`. +_Answer:_ 3) 12345678 undefined -## Q. ***Write a script that returns the number of occurrences of character given a string as input?*** +## Q. What would be the output of following code? ```javascript -function countCharacters(str) { - return str - .replace(/ /g, "") - .toLowerCase() - .split("") - .reduce((arr, character) => { - if (character in arr) { - arr[character]++; - } else { - arr[character] = 1; - } - return arr; - }, {}); +var employeeId = "aq123"; +function Employee() { + this.employeeId = "bq1uy"; } -console.log(countCharacters("the brown fox jumps over the lazy dog")); +console.log(Employee.employeeId); ``` +1. Reference Error +2. aq123 +3. bq1uy +4. undefined + +_Answer:_ 4) undefined + -## Q. ***What is the value of `foo`?*** +## Q. What would be the output of following code? ```javascript -var foo = 10 + "20"; +var employeeId = "aq123"; + +function Employee() { + this.employeeId = "bq1uy"; +} +console.log(new Employee().employeeId); +Employee.prototype.employeeId = "kj182"; +Employee.prototype.JobId = "1BJKSJ"; +console.log(new Employee().JobId); +console.log(new Employee().employeeId); ``` -_Answer:_ `'1020'`, because of type coercion from Number to String +1. bq1uy 1BJKSJ bq1uy undefined +2. bq1uy 1BJKSJ bq1uy +3. bq1uy 1BJKSJ kj182 +4. undefined 1BJKSJ kj182 + +_Answer:_ 2) bq1uy 1BJKSJ bq1uy -## Q. ***How would you make this work?*** +## Q. What would be the output of following code? ```javascript -add(2, 5); // 7 -add(2)(5); // 7 +var employeeId = "aq123"; +(function Employee() { + try { + throw "foo123"; + } catch (employeeId) { + console.log(employeeId); + } + console.log(employeeId); +})(); ``` -_Answer:_ A general solution for any number of parameters +1. foo123 aq123 +2. foo123 foo123 +3. aq123 aq123 +4. foo123 undefined -```js -"use strict"; - -let sum = (arr) => arr.reduce((a, b) => a + b); -let addGenerator = (numArgs, prevArgs) => { - return function () { - let totalArgs = prevArgs.concat(Array.from(arguments)); - if (totalArgs.length === numArgs) { - return sum(totalArgs); - } - return addGenerator(numArgs, totalArgs); - }; -}; - -let add = addGenerator(2, []); - -add(2, 5); // 7 -add(2)(5); // 7 -add()(2, 5); // 7 -add()(2)(5); // 7 -add()()(2)(5); // 7 -``` +_Answer:_ 1) foo123 aq123 -## Q. ***What value is returned from the following statement?*** +## Q. What would be the output of following code? ```javascript -"i'm a lasagna hog".split("").reverse().join(""); +(function () { + var greet = "Hello World"; + var toGreet = [].filter.call(greet, function (element, index) { + return index > 5; + }); + console.log(toGreet); +})(); ``` -_Answer:_ It's actually a reverse method for a string - `'goh angasal a m\'i'` - -## Q. ***What is the value of `window.foo`?*** - -```javascript -window.foo || (window.foo = "bar"); -``` +1. Hello World +2. undefined +3. World +4. [ 'W', 'o', 'r', 'l', 'd' ] -_Answer:_ Always `'bar'` +_Answer:_ 4) [ 'W', 'o', 'r', 'l', 'd' ] -## Q. ***What is the outcome of the two alerts below?*** +## Q. What would be the output of following code? ```javascript -var foo = "Hello"; (function () { - var bar = " World"; - alert(foo + bar); + var fooAccount = { + name: "John", + amount: 4000, + deductAmount: function (amount) { + this.amount -= amount; + return "Total amount left in account: " + this.amount; + }, + }; + var barAccount = { + name: "John", + amount: 6000, + }; + var withdrawAmountBy = function (totalAmount) { + return fooAccount.deductAmount.bind(barAccount, totalAmount); + }; + console.log(withdrawAmountBy(400)()); + console.log(withdrawAmountBy(300)()); })(); -alert(foo + bar); ``` -_Answer:_ +1. Total amount left in account: 5600 Total amount left in account: 5300 +2. undefined undefined +3. Total amount left in account: 3600 Total amount left in account: 3300 +4. Total amount left in account: 5600 Total amount left in account: 5600 -- First: `Hello World` -- Second: Throws an exception, `ReferenceError: bar is not defined` +_Answer:_ 1) Total amount left in account: 5600 Total amount left in account: 5300 -## Q. ***What is the value of `foo.length`?*** + + +## Q. What would be the output of following code? ```javascript -var foo = []; -foo.push(1); -foo.push(2); +(function () { + var fooAccount = { + name: "John", + amount: 4000, + deductAmount: function (amount) { + this.amount -= amount; + return this.amount; + }, + }; + var barAccount = { + name: "John", + amount: 6000, + }; + var withdrawAmountBy = function (totalAmount) { + return fooAccount.deductAmount.apply(barAccount, [totalAmount]); + }; + console.log(withdrawAmountBy(400)); + console.log(withdrawAmountBy(300)); + console.log(withdrawAmountBy(200)); +})(); ``` -_Answer:_ `.push` is mutable - `2` +1. 5600 5300 5100 +2. 3600 3300 3100 +3. 5600 3300 5100 +4. undefined undefined undefined + +_Answer:_ 1) 5600 5300 5100 -## Q. ***What is the value of `foo.x`?*** +## Q. What would be the output of following code? ```javascript -var foo = { n: 1 }; -var bar = foo; -foo.x = foo = { n: 2 }; +(function () { + var fooAccount = { + name: "John", + amount: 6000, + deductAmount: function (amount) { + this.amount -= amount; + return this.amount; + }, + }; + var barAccount = { + name: "John", + amount: 4000, + }; + var withdrawAmountBy = function (totalAmount) { + return fooAccount.deductAmount.call(barAccount, totalAmount); + }; + console.log(withdrawAmountBy(400)); + console.log(withdrawAmountBy(300)); + console.log(withdrawAmountBy(200)); +})(); ``` -_Answer:_ `undefined`. Rather, `bar.x` is `{n: 2}`. +1. 5600 5300 5100 +2. 3600 3300 3100 +3. 5600 3300 5100 +4. undefined undefined undefined -`foo.x = foo = {n: 2}` is the same as `foo.x = (foo = {n: 2})`. It is because -a left term is first referenced and then a right term is evaluated when an -assignment is performed in JavaScript. When `foo.x` is referenced, it refers -to an original object, `{n: 1}`. So, when the result of the right term, `{n: 2}`, is evaluated, it will assigned to the original object, which is at the -moment referenced by `bar`. +_Answer:_ 2) 3600 3300 3100 -## Q. ***What does the following code print?*** +## Q. What would be the output of following code? ```javascript -console.log("one"); -setTimeout(function () { - console.log("two"); -}, 0); -console.log("three"); +(function greetNewCustomer() { + console.log("Hello " + this.name); +}.bind({ + name: "John", +})()); ``` -_Answer:_ `one`, `three` and `two`. It's because `console.log('two');` will be -invoked in the next event loop. +1. Hello John +2. Reference Error +3. Window +4. undefined -## Q. ***For which value of x the results of the following statements are not the same?*** +_Answer:_ 1) Hello John + +## Q. What would be the output of following code? ```javascript -// if( x <= 100 ) {...} -if( !(x > 100) ) {...} +function getDataFromServer(apiUrl) { + var name = "John"; + return { + then: function (fn) { + fn(name); + }, + }; +} + +getDataFromServer("www.google.com").then(function (name) { + console.log(name); +}); ``` -_Answer:_ `NaN <= 100` is `false` and `NaN > 100` is also false, so if the value of `x` is `NaN`, the statements are not the same. +1. John +2. undefined +3. Reference Error +4. fn is not defined -The same holds true for any value of x that being converted to Number, returns NaN, e.g.: `undefined`, `[1,2,5]`, `{a:22}`, etc. +_Answer:_ 1) John + + -## Q. ***What is g value?*** +## Q. What would be the output of following code? ```javascript -f = g = 0; (function () { - try { - f = - function () { - return f(); - } && f(); - } catch (e) { - return g++ && f(); - } finally { - return ++g; - } - function f() { - g += 5; - return 0; - } + var arrayNumb = [2, 8, 15, 16, 23, 42]; + Array.prototype.sort = function (a, b) { + return a - b; + }; + arrayNumb.sort(); + console.log(arrayNumb); +})(); + +(function () { + var numberArray = [2, 8, 15, 16, 23, 42]; + numberArray.sort(function (a, b) { + if (a == b) { + return 0; + } else { + return a < b ? -1 : 1; + } + }); + console.log(numberArray); +})(); + +(function () { + var numberArray = [2, 8, 15, 16, 23, 42]; + numberArray.sort(function (a, b) { + return a - b; + }); + console.log(numberArray); })(); ``` +1. [ 2, 8, 15, 16, 23, 42 ] + [ 2, 8, 15, 16, 23, 42 ] + [ 2, 8, 15, 16, 23, 42 ] +2. undefined undefined undefined +3. [42, 23, 16, 15, 8, 2] + [42, 23, 16, 15, 8, 2] + [42, 23, 16, 15, 8, 2] +4. Reference Error + +_Answer:_ 1) [ 2, 8, 15, 16, 23, 42 ] +[ 2, 8, 15, 16, 23, 42 ] +[ 2, 8, 15, 16, 23, 42 ] + -## Q. ***What will be the output?*** +## Q. What would be the output of following code? ```javascript -function b(b) { - return this.b && b(b); -} -b(b.bind(b)); +(function () { + function sayHello() { + var name = "Hi John"; + return; + { + fullName: name; + } + } + console.log(sayHello().fullName); +})(); ``` -## Q. ***What will be the output?*** +1. Hi John +2. undefined +3. Reference Error +4. Uncaught TypeError: Cannot read property 'fullName' of undefined -```javascript -c = (c) => { - return this.c && c(c); -}; -c(c.bind(c)); -``` - -## Q. ***Predict the output of the following JavaScript code?*** - -```javascript -var g = 0; -g = 1 && g++; -console.log(g); -``` - -## Q. ***Predict the output of the following JavaScript code?*** - -```javascript -!function(){}() -function(){}() -true && function(){}() -(function(){})() -function(){} -!function(){} -``` +_Answer:_ 4) Uncaught TypeError: Cannot read property 'fullName' of undefined -## Q. ***What will expression return? +## Q. What would be the output of following code? ```javascript -var a = (b = true), - c = (a) => a; -(function a(a = (c(b).a = c = () => a)) { - return a(); -})(); -``` - -## Q. ***Predict the output of the following JavaScript code?*** +function getNumber() { + return 2, 4, 5; +} -```javascript -var a = true; -(a = function () { - return a; -})(); +var numb = getNumber(); +console.log(numb); ``` -## Q. ***What will be the output?*** +1. 5 +2. undefined +3. 2 +4. (2,4,5) -```javascript -var v = 0; -try { - throw (v = (function (c) { - throw (v = function (a) { - return v; - }); - })()); -} catch (e) { - console.log(e()()); -} -``` +_Answer:_ 1) 5 -## Q. ***What will the following code output?*** +## Q. What would be the output of following code? ```javascript -const arr = [10, 12, 15, 21]; -for (var i = 0; i < arr.length; i++) { - setTimeout(function () { - console.log("Index: " + i + ", element: " + arr[i]); - }, 3000); +function getNumber() { + return; } -``` - -## Q. ***What will be the output of the following code?*** - -```javascript -var output = (function (x) { - delete x; - return x; -})(0); -console.log(output); -``` - -## Q. ***What will be the output of the following code?*** - -```javascript -var Employee = { - company: "xyz", -}; -var emp1 = Object.create(Employee); -delete emp1.company; -console.log(emp1.company); +var numb = getNumber(); +console.log(numb); ``` - +1. null +2. undefined +3. "" +4. 0 -## Q. ***Make this work: +_Answer:_ 2) undefined -```javascript -duplicate([1, 2, 3, 4, 5]); // [1,2,3,4,5,1,2,3,4,5] -``` +## Q. What would be the output of following code? ```javascript -function duplicate(arr) { - return arr.concat(arr); +function mul(x) { + return function (y) { + return [ + x * y, + function (z) { + return x * y + z; + }, + ]; + }; } -duplicate([1, 2, 3, 4, 5]); // [1,2,3,4,5,1,2,3,4,5] +console.log(mul(2)(3)[0]); +console.log(mul(2)(3)[1](4)); ``` +1. 6, 10 +2. undefined undefined +3. Reference Error +4. 10, 6 + +_Answer:_ 1) 6, 10 + -## Q. ***Fix the bug using ES5 only?*** +## Q. What would be the output of following code? ```javascript -var arr = [10, 32, 65, 2]; -for (var i = 0; i < arr.length; i++) { - setTimeout(function () { - console.log("The index of this number is: " + i); - }, 3000); +function mul(x) { + return function (y) { + return { + result: x * y, + sum: function (z) { + return x * y + z; + }, + }; + }; } +console.log(mul(2)(3).result); +console.log(mul(2)(3).sum(4)); ``` -For ES6, you can just replace `var i` with `let i`. +1. 6, 10 +2. undefined undefined +3. Reference Error +4. 10, 6 -For ES5, you need to create a function scope like here: +_Answer:_ 1) 6, 10 + +## Q. What would be the output of following code? ```javascript -var arr = [10, 32, 65, 2]; -for (var i = 0; i < arr.length; i++) { - setTimeout( - (function (j) { - return function () { - console.log("The index of this number is: " + j); +function mul(x) { + return function (y) { + return function (z) { + return function (w) { + return function (p) { + return x * y * z * w * p; + }; }; - })(i), - 3000 - ); + }; + }; } +console.log(mul(2)(3)(4)(5)(6)); ``` +1. 720 +2. undefined +3. Reference Error +4. Type Error + +_Answer:_ 1) 720 + -## Q. ***What will be the output of the following code?*** +## Q. What is the value of `foo`? ```javascript -console.log(eval("10 + 10")); // 20 - -console.log(eval("5 + 5" + 10)); // 515 +var foo = 10 + "20"; +``` -console.log(eval("5 + 5 + 5" + 10)); // 520 +_Answer:_ `'1020'`, because of type coercion from Number to String -console.log(eval(10 + "5 + 5")); // 110 +## Q. How would you make this work? -console.log(eval(10 + "5 + 5 + 5")); // 115 +```javascript +add(2, 5); // 7 +add(2)(5); // 7 ``` -## Q. ***What will be the output of the following code?*** +_Answer:_ A general solution for any number of parameters ```javascript -var x = 10; -var y = 20; -var a = eval("x * y") + "
"; -var b = eval("2 + 2") + "
"; -var c = eval("x + 30") + "
"; +"use strict"; -let result = a + b + c; -console.log(result); // 200
4
40
+let sum = (arr) => arr.reduce((a, b) => a + b); +let addGenerator = (numArgs, prevArgs) => { + return function () { + let totalArgs = prevArgs.concat(Array.from(arguments)); + if (totalArgs.length === numArgs) { + return sum(totalArgs); + } + return addGenerator(numArgs, totalArgs); + }; +}; + +let add = addGenerator(2, []); + +add(2, 5); // 7 +add(2)(5); // 7 +add()(2, 5); // 7 +add()(2)(5); // 7 +add()()(2)(5); // 7 ``` -## Q. ***What will be the output of the following code?*** +## Q. What value is returned from the following statement? ```javascript -// Example 01: -var prices = [12, 20, 18]; -var newPriceArray = [...prices]; -console.log(newPriceArray); +"i'm a lasagna hog".split("").reverse().join(""); +``` -// Example 02: -var alphabets = ["A", ..."BCD", "E"]; -console.log(alphabets); +_Answer:_ It's actually a reverse method for a string - `'goh angasal a m\'i'` -// Example 03: -var prices = [12, 20, 18]; -var maxPrice = Math.max(...prices); -console.log(maxPrice); +## Q. What is the value of `window.foo`? -// Example 04: -var max = Math.max(..."43210"); -console.log(max); +```javascript +window.foo || (window.foo = "bar"); +``` -// Example 05: -const fruits = ["apple", "orange"]; -const vegetables = ["carrot", "potato"]; +_Answer:_ Always `'bar'` -const result = ["bread", ...vegetables, "chicken", ...fruits]; -console.log(result); +## Q. What is the outcome of the two alerts below? -// Example 06: -const country = "USA"; -console.log([...country]); +```javascript +var foo = "Hello"; +(function () { + var bar = " World"; + alert(foo + bar); +})(); +alert(foo + bar); ``` +_Answer:_ + +- First: `Hello World` +- Second: Throws an exception, `ReferenceError: bar is not defined` + -## Q. ***Given and object and property path. Get value from property path*** +## Q. What is the value of `foo.length`? ```javascript -function getPropertyValue(TEMP_OBJECT, path) { - return path.split('.').reduce((prev, key) => { - return prev ? prev[key] : undefined; - }, TEMP_OBJECT) -} +var foo = []; +foo.push(1); +foo.push(2); +``` -//Input : -let srcObject = { - 'system' : { - 'database' : { - '0' : { - 'host' : '54.232.122', - 'port' : 3306 - }, - '1' : { - 'host' : '54.232.123', - }, - 'port' : 3307 - '2' : { - 'host' : '54.232.123', - } - } - } -}, -path = "system.database.1.port"; +_Answer:_ `.push` is mutable - `2` -//Output: 3307 +## Q. What is the value of `foo.x`? + +```javascript +var foo = { n: 1 }; +var bar = foo; +foo.x = foo = { n: 2 }; ``` +_Answer:_ `undefined`. Rather, `bar.x` is `{n: 2}`. + +`foo.x = foo = {n: 2}` is the same as `foo.x = (foo = {n: 2})`. It is because +a left term is first referenced and then a right term is evaluated when an +assignment is performed in JavaScript. When `foo.x` is referenced, it refers +to an original object, `{n: 1}`. So, when the result of the right term, `{n: 2}`, is evaluated, it will assigned to the original object, which is at the +moment referenced by `bar`. + -## Q. ***How to filter object from Arrays of Objects*** +## Q. What does the following code print? ```javascript -let filteredArray = [{name: 'john'},{name: 'kelly'}].filter(value => value.name === 'kelly'); - -Filter method return Array of objects +console.log("one"); +setTimeout(function () { + console.log("two"); +}, 0); +console.log("three"); ``` -## Q. ***How to replace all the occurrences of string*** +_Answer:_ `one`, `three` and `two`. It's because `console.log('two');` will be +invoked in the next event loop. -```javascript -str = str.replace(/test/g, ""); -``` +## Q. What would be the result of 1+2+'3'? - +The output is going to be `33`. Since `1` and `2` are numeric values, the result of first two digits is going to be a numeric value `3`. The next digit is a string type value because of that the addition of numeric value `3` and string type value `3` is just going to be a concatenation value `33`. -## Q. ***Write a script that returns the number of occurrences of character given a string as input*** +## Q. Write a script that returns the number of occurrences of character given a string as input? ```javascript function countCharacters(str) { @@ -3439,13 +3491,13 @@ function countCharacters(str) { .replace(/ /g, "") .toLowerCase() .split("") - .reduce((p, c) => { - if (c in p) { - p[c]++; + .reduce((arr, character) => { + if (character in arr) { + arr[character]++; } else { - p[c] = 1; + arr[character] = 1; } - return p; + return arr; }, {}); } console.log(countCharacters("the brown fox jumps over the lazy dog")); @@ -3455,966 +3507,756 @@ console.log(countCharacters("the brown fox jumps over the lazy dog")); ↥ back to top

-## Q. ***write a script that return the number of occurrences of a character in paragraph*** +## Q. What is the value of `foo`? ```javascript -function charCount(str, searchChar) { - let count = 0; - if (str) { - let stripStr = str.replace(/ /g, "").toLowerCase(); //remove spaces and covert to lowercase - for (let chr of stripStr) { - if (chr === searchChar) { - count++; - } - } - } - return count; -} -console.log(charCount("the brown fox jumps over the lazy dog", "o")); +var foo = 10 + "20"; ``` -
- ↥ back to top -
+_Answer:_ `'1020'`, because of type coercion from Number to String -## Q. ***Recursive and non-recursive Factorial function*** +## Q. How would you make this work? ```javascript -function recursiveFactorial(n) { - if (n < 1) { - throw Error("Value of N has to be greater then 1"); - } - if (n === 1) { - return 1; - } else { - return n * recursiveFactorial(n - 1); - } -} +add(2, 5); // 7 +add(2)(5); // 7 +``` -console.log(recursiveFactorial(5)); +_Answer:_ A general solution for any number of parameters -function factorial(n) { - if (n < 1) { - throw Error("Value of N has to be greater then 1"); - } - if (n === 1) { - return 1; - } - let result = 1; - for (let i = 1; i <= n; i++) { - result = result * i; - } - return result; -} +```js +"use strict"; -console.log(factorial(5)); +let sum = (arr) => arr.reduce((a, b) => a + b); +let addGenerator = (numArgs, prevArgs) => { + return function () { + let totalArgs = prevArgs.concat(Array.from(arguments)); + if (totalArgs.length === numArgs) { + return sum(totalArgs); + } + return addGenerator(numArgs, totalArgs); + }; +}; + +let add = addGenerator(2, []); + +add(2, 5); // 7 +add(2)(5); // 7 +add()(2, 5); // 7 +add()(2)(5); // 7 +add()()(2)(5); // 7 ```
↥ back to top
-## Q. ***Recursive and non recursive fibonacci-sequence*** +## Q. What value is returned from the following statement? ```javascript -// 1, 1, 2, 3, 5, 8, 13, 21, 34 - -function recursiveFibonacci(num) { - if (num <= 1) { - return 1; - } else { - return recursiveFibonacci(num - 1) + recursiveFibonacci(num - 2); - } -} +"i'm a lasagna hog".split("").reverse().join(""); +``` -console.log(recursiveFibonacci(8)); +_Answer:_ It's actually a reverse method for a string - `'goh angasal a m\'i'` -function fibonnaci(num) { - let a = 1, - b = 0, - temp; - while (num >= 0) { - temp = a; - a = a + b; - b = temp; - num--; - } - return b; -} +## Q. What is the value of `window.foo`? -console.log(fibonnaci(7)); +```javascript +window.foo || (window.foo = "bar"); +``` -// Memoization fibonnaci +_Answer:_ Always `'bar'` -function fibonnaci(num, memo = {}) { - if (num in memo) { - return memo[num]; - } - if (num <= 1) { - return 1; - } - return (memo[num] = fibonnaci(num - 1, memo) + fibonnaci(num - 2, memo)); -} +## Q. What is the outcome of the two alerts below? -console.log(fibonnaci(5)); // 8 +```javascript +var foo = "Hello"; +(function () { + var bar = " World"; + alert(foo + bar); +})(); +alert(foo + bar); ``` -## Q. ***Random Number between min and max*** +_Answer:_ + +- First: `Hello World` +- Second: Throws an exception, `ReferenceError: bar is not defined` + +## Q. What is the value of `foo.length`? ```javascript -// 5 to 7 -let min = 5; -let max = 7; -console.log(min + Math.floor(Math.random() * (max - min + 1))); +var foo = []; +foo.push(1); +foo.push(2); ``` +_Answer:_ `.push` is mutable - `2` +
↥ back to top
-## Q. ***Get HTML form values as JSON object*** +## Q. What is the value of `foo.x`? ```javascript -// Use the array reduce function with form elements. -const formToJSON = (elements) => - [].reduce.call( - elements, - (data, element) => { - data[element.name] = element.value; - // Check if name and value exist on element - // Check if it checkbox or radio button which can select multiple or single - //check for multiple select options - return data; - }, - {} - ); - -// pass the elements to above method, to get values -document.querySelector("HTML_FORM_CLASS").elements; +var foo = { n: 1 }; +var bar = foo; +foo.x = foo = { n: 2 }; ``` +_Answer:_ `undefined`. Rather, `bar.x` is `{n: 2}`. + +`foo.x = foo = {n: 2}` is the same as `foo.x = (foo = {n: 2})`. It is because +a left term is first referenced and then a right term is evaluated when an +assignment is performed in JavaScript. When `foo.x` is referenced, it refers +to an original object, `{n: 1}`. So, when the result of the right term, `{n: 2}`, is evaluated, it will assigned to the original object, which is at the +moment referenced by `bar`. +
↥ back to top
-## Q. ***Reverse the number*** +## Q. What does the following code print? ```javascript -function reverse(num) { - let result = 0; - while (num != 0) { - result = result * 10; - result = result + (num % 10); - num = Math.floor(num / 10); - } - return result; -} - -console.log(reverse(12345)); +console.log("one"); +setTimeout(function () { + console.log("two"); +}, 0); +console.log("three"); ``` -
- ↥ back to top -
+_Answer:_ `one`, `three` and `two`. It's because `console.log('two');` will be +invoked in the next event loop. -## Q. ***Remove Duplicate elements from Array*** +## Q. For which value of x the results of the following statements are not the same? ```javascript -var arr = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; -function removeDuplicate() { - return ar.reduce((prev, current) => { - //Cannot use includes of array, since it is not supported by many browser - if (prev.indexOf(current) === -1) { - prev.push(current); - } - return prev; - }, []); -} -console.log(removeDuplicate(ar)); +// if( x <= 100 ) {...} +if( !(x > 100) ) {...} +``` -const removeDuplicates = (arr) => { - let holder = {}; - return arr.filter((el) => { - if (!holder[el]) { - holder[el] = true; - return true; - } - return false; - }); -}; -const arr = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; -console.log(removeDuplicates(arr)); // ["1", "2", "3", "5", "8", "9"] // O(n) - -// Es6 -console.log([...new Set(arr)]); -``` +_Answer:_ `NaN <= 100` is `false` and `NaN > 100` is also false, so if the value of `x` is `NaN`, the statements are not the same. -
- ↥ back to top -
+The same holds true for any value of x that being converted to Number, returns NaN, e.g.: `undefined`, `[1,2,5]`, `{a:22}`, etc. -## Q. ***Deep copy of object or clone of object*** +## Q. What is g value? ```javascript -function deepExtend(out = {}) { - for (let i = 1; i < arguments.length; i++) { - let obj = arguments[i]; - if (obj == null) - // skip undefined and null [check with double equal not triple] - continue; - - obj = Object(obj); - - for (let key in obj) { - // avoid shadow hasownproperty of parent - if (Object.prototype.hasOwnProperty.call(obj, key)) { - if ( - typeof obj[key] === "object" && - !Array.isArray(obj[key]) && - obj[key] != null - ) - out[key] = deepExtend(out[key], obj[key]); - else out[key] = obj[key]; - } - } +f = g = 0; +(function () { + try { + f = + function () { + return f(); + } && f(); + } catch (e) { + return g++ && f(); + } finally { + return ++g; } - return out; -} - -//Alternative if there are no function -let cloneObj = JSON.parse(JSON.stringify(obj)); - -console.log(deepExtend({}, { a: 1, b: { c: 2, d: 3 } }, { e: 4, b: { f: 1 } })); -//output : { a: 1, b: {c: 2, d: 3, f: 1}, e: 4 } + function f() { + g += 5; + return 0; + } +})(); ```
↥ back to top
-## Q. ***Sort ticket based on flying order.*** +## Q. What will be the output? ```javascript -"use strict"; +function b(b) { + return this.b && b(b); +} +b(b.bind(b)); +``` -function SortTickets(tickets) { - this.tickets = tickets; +## Q. What will be the output? - // reverse the order of tickets - this.reverseTickets = {}; - for (let key in this.tickets) { - this.reverseTickets[tickets[key]] = key; - } +```javascript +c = (c) => { + return this.c && c(c); +}; +c(c.bind(c)); +``` - // Get the starting point of ticket - let orderedTivckets = [...this.getStartingPoint()]; +## Q. Predict the output of the following JavaScript code? - // Get the ticket destination. - let currentValue = orderedTickets[orderedTickets.length - 1]; - while (currentValue) { - currentValue = this.tickets[currentValue]; - if (currentValue) { - orderedTickets.push(currentValue); - } - } - console.log(orderedTickets); -} +```javascript +var g = 0; +g = 1 && g++; +console.log(g); +``` -SortTickets.prototype.getStartingPoint = function () { - for (let tick in this.tickets) { - if (!(tick in this.reverseTickets)) { - return [tick, this.tickets[tick]]; - } - } - return null; -}; +## Q. Predict the output of the following JavaScript code? -new SortTickets({ - Athens: "Rio", - Barcelona: "Athens", - London: "NYC", - ND: "Lahore", - NYC: "Barcelona", - Rio: "ND", -}); +```javascript +!function(){}() +function(){}() +true && function(){}() +(function(){})() +function(){} +!function(){} ``` -
- ↥ back to top -
- -## Q. ***Cuncurrent execute function based on input number*** +## Q. What will expression return? ```javascript -function concurrent(num) { - this.queue = []; - this.num = num; -} +var a = (b = true), + c = (a) => a; +(function a(a = (c(b).a = c = () => a)) { + return a(); +})(); +``` -concurrent.prototype.enqueue = function (value) { - this.queue.push(value); -}; +## Q. Predict the output of the following JavaScript code? -concurrent.prototype.start = function () { - this.runningCount = 0; - while (this.queue.length > 0) { - if (this.runningCount < this.num) { - this.queue.pop().call(this, () => { - this.runningCount--; - let count = this.runningCount; - if (count === 0) { - this.start(); - } - }); - this.runningCount++; - } - } -}; +```javascript +var a = true; +(a = function () { + return a; +})(); +``` -let callback = (done) => { - console.log("starting"); - setTimeout(() => { - console.log("stopped"); - done(); - }, 200); -}; +## Q. What will be the output? -let c = new concurrent(2); -c.enqueue(callback); -c.enqueue(callback); -c.enqueue(callback); -c.enqueue(callback); -c.enqueue(callback); -c.enqueue(callback); -c.start(); +```javascript +var v = 0; +try { + throw (v = (function (c) { + throw (v = function (a) { + return v; + }); + })()); +} catch (e) { + console.log(e()()); +} ```
↥ back to top
-## Q. ***Reversing an array*** +## Q. What will the following code output? ```javascript -let a = [1, 2, 3, 4, 5]; - -//Approach 1: -console.log(a.reverse()); - -//Approach 2: -let reverse = a.reduce((prev, current) => { - prev.unshift(current); - return prev; -}, []); - -console.log(reverse); +const arr = [10, 12, 15, 21]; +for (var i = 0; i < arr.length; i++) { + setTimeout(function () { + console.log("Index: " + i + ", element: " + arr[i]); + }, 3000); +} ``` -## Q. ***Rotate 2D array*** +## Q. What will be the output of the following code? ```javascript -const transpose = (arr) => arr[0].map((col, i) => arr.map((row) => row[i])); +var output = (function (x) { + delete x; + return x; +})(0); -console.log( - transpose([ - [1, 2, 3, 4], - [5, 6, 7, 8], - [9, 10, 11, 12], - ]) -); +console.log(output); ``` -## Q. ***Get Column from 2D Array*** +## Q. What will be the output of the following code? ```javascript -const getColumn = (arr, n) => arr.map((x) => x[n]); +var Employee = { + company: "xyz", +}; +var emp1 = Object.create(Employee); +delete emp1.company; +console.log(emp1.company); +``` -const twoDimensionalArray = [ - [1, 2, 3], - [4, 5, 6], - [7, 8, 9], -]; +
+ ↥ back to top +
-console.log(getColumn(twoDimensionalArray, 1)); //Result = [2,5,8] -``` +## Q. Make this work: -## Q. ***Get top N from array*** +```javascript +duplicate([1, 2, 3, 4, 5]); // [1,2,3,4,5,1,2,3,4,5] +``` ```javascript -function topN(arr, num) { - let sorted = arr.sort((a, b) => a - b); - return sorted.slice(sorted.length - num, sorted.length); +function duplicate(arr) { + return arr.concat(arr); } -console.log(topN([1, 8, 3, 4, 5], 2)); // [5,8] +duplicate([1, 2, 3, 4, 5]); // [1,2,3,4,5,1,2,3,4,5] ```
↥ back to top
-## Q. ***Get query params from Object*** +## Q. Fix the bug using ES5 only? ```javascript -function getQueryParams(obj) { - let parms = ""; - for (let key in obj) { - if (obj.hasOwnProperty(key)) { - if (parms.length > 0) { - parms += "&"; - } - parms += encodeURI(`${key}=${obj[key]}`); - } - } - return parms; +var arr = [10, 32, 65, 2]; +for (var i = 0; i < arr.length; i++) { + setTimeout(function () { + console.log("The index of this number is: " + i); + }, 3000); } - -console.log( - getQueryParams({ - name: "Umesh", - tel: "48289", - add: "3333 emearld st", - }) -); ``` -
- ↥ back to top -
+For ES6, you can just replace `var i` with `let i`. -## Q. ***Consecutive 1's in binary*** +For ES5, you need to create a function scope like here: ```javascript -function consecutiveOne(num) { - let binaryArray = num.toString(2); - - let maxOccurence = 0, - occurence = 0; - for (let val of binaryArray) { - if (val === "1") { - occurence += 1; - maxOccurence = Math.max(maxOccurence, occurence); - } else { - occurence = 0; - } - } - return maxOccurence; +var arr = [10, 32, 65, 2]; +for (var i = 0; i < arr.length; i++) { + setTimeout( + (function (j) { + return function () { + console.log("The index of this number is: " + j); + }; + })(i), + 3000 + ); } -//13 = 1101 = 2 -//5 = 101 = 1 -console.log(consecutiveOne(5)); //1 ```
↥ back to top
-## Q. ***Spiral travesal of matrix*** +## Q. What will be the output of the following code? ```javascript -var input = [ - [1, 2, 3, 4], - [5, 6, 7, 8], - [9, 10, 11, 12], - [13, 14, 15, 16], -]; - -var spiralTraversal = function (matriks) { - let result = []; - var goAround = function (matrix) { - if (matrix.length === 0) { - return; - } +console.log(eval("10 + 10")); // 20 - // right - result = result.concat(matrix.shift()); +console.log(eval("5 + 5" + 10)); // 515 - // down - for (var j = 0; j < matrix.length - 1; j++) { - result.push(matrix[j].pop()); - } +console.log(eval("5 + 5 + 5" + 10)); // 520 - // bottom - result = result.concat(matrix.pop().reverse()); +console.log(eval(10 + "5 + 5")); // 110 - // up - for (var k = matrix.length - 1; k > 0; k--) { - result.push(matrix[k].shift()); - } +console.log(eval(10 + "5 + 5 + 5")); // 115 +``` - return goAround(matrix); - }; +## Q. What will be the output of the following code? - goAround(matriks); +```javascript +var x = 10; +var y = 20; +var a = eval("x * y") + "
"; +var b = eval("2 + 2") + "
"; +var c = eval("x + 30") + "
"; - return result; -}; -console.log(spiralTraversal(input)); // [1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10] +let result = a + b + c; +console.log(result); // 200
4
40
```
↥ back to top
-## Q. ***Merge Sorted array and sort it.*** +## Q. What will be the output of the following code? ```javascript -function mergeSortedArray(arr1, arr2) { - return [...new Set(arr1.concat(arr2))].sort((a, b) => a - b); -} +// Example 01: +var prices = [12, 20, 18]; +var newPriceArray = [...prices]; +console.log(newPriceArray); -console.log(mergeSortedArray([1, 2, 3, 4, 5, 6], [0, 3, 4, 7])); // [0, 1, 2, 3, 4, 5, 6, 7] -``` +// Example 02: +var alphabets = ["A", ..."BCD", "E"]; +console.log(alphabets); -
- ↥ back to top -
+// Example 03: +var prices = [12, 20, 18]; +var maxPrice = Math.max(...prices); +console.log(maxPrice); -## Q. ***Anagram of words*** +// Example 04: +var max = Math.max(..."43210"); +console.log(max); -```javascript -const alphabetize = (word) => word.split("").sort().join(""); +// Example 05: +const fruits = ["apple", "orange"]; +const vegetables = ["carrot", "potato"]; -function groupAnagram(wordsArr) { - return wordsArr.reduce((p, c) => { - const sortedWord = alphabetize(c); - if (sortedWord in p) { - p[sortedWord].push(c); - } else { - p[sortedWord] = [c]; - } - return p; - }, {}); -} +const result = ["bread", ...vegetables, "chicken", ...fruits]; +console.log(result); -console.log( - groupAnagram(["map", "art", "how", "rat", "tar", "who", "pam", "shoop"]) -); -// result : { -// amp: ["map", "pam"], -// art: ["art", "rat", "tar"], -// hoops: ["shoop"], -// how: ["how", "who"] -// } +// Example 06: +const country = "USA"; +console.log([...country]); ```
↥ back to top
-## Q. ***Print the largest (maximum) hourglass sum found in 2d array.*** +## Q. Given and object and property path. Get value from property path ```javascript -// if arr 6 X 6 then iterate it till 4 X 4 [reduce by two] -// if arr 8 X 8 then iterate it till 6 X 6 [reduce by two] -function main(arr) { - let maxScore = -999; - let len = arr.length; - for (let i = 0; i < len - 2; i++) { - for (let j = 0; j < len - 2; j++) { - let total = - arr[i][j] + - arr[i][j + 1] + - arr[i][j + 2] + - arr[i + 1][j + 1] + - arr[i + 2][j] + - arr[i + 2][j + 1] + - arr[i + 2][j + 2]; +function getPropertyValue(TEMP_OBJECT, path) { + return path.split('.').reduce((prev, key) => { + return prev ? prev[key] : undefined; + }, TEMP_OBJECT) +} + +//Input : +let srcObject = { + 'system' : { + 'database' : { + '0' : { + 'host' : '54.232.122', + 'port' : 3306 + }, + '1' : { + 'host' : '54.232.123', + }, + 'port' : 3307 + '2' : { + 'host' : '54.232.123', + } + } + } +}, +path = "system.database.1.port"; - maxScore = Math.max(maxScore, total); - } - } - console.log(maxScore); -} +//Output: 3307 ```
↥ back to top
-## Q. ***Transform array of object to array*** +## Q. How to filter object from Arrays of Objects ```javascript -let data = [ - { vid: "aaa", san: 12 }, - { vid: "aaa", san: 18 }, - { vid: "aaa", san: 2 }, - { vid: "bbb", san: 33 }, - { vid: "bbb", san: 44 }, - { vid: "aaa", san: 100 }, -]; - -let newData = data.reduce((acc, item) => { - acc[item.vid] = acc[item.vid] || { vid: item.vid, san: [] }; - acc[item.vid]["san"].push(item.san); - return acc; -}, {}); - -console.log(Object.keys(newData).map((key) => newData[key])); +let filteredArray = [{name: 'john'},{name: 'kelly'}].filter(value => value.name === 'kelly'); -// Result -// [[object Object] { -// san: [12, 18, 2, 100], -// vid: "aaa" -// }, [object Object] { -// san: [33, 44], -// vid: "bbb" -// }] +Filter method return Array of objects ``` -
- ↥ back to top -
- -## Q. ***Create a private variable or private method in object*** +## Q. How to replace all the occurrences of string ```javascript -let obj = (function () { - function getPrivateFunction() { - console.log("this is private function"); - } - let p = "You are accessing private variable"; - return { - getPrivateProperty: () => { - console.log(p); - }, - callPrivateFunction: getPrivateFunction, - }; -})(); - -obj.getPrivateValue(); // You are accessing private variable -console.log("p" in obj); // false -obj.callPrivateFunction(); // this is private function +str = str.replace(/test/g, ""); ```
↥ back to top
-## Q. ***Flatten only Array not objects*** +## Q. Write a script that returns the number of occurrences of character given a string as input ```javascript -function flatten(arr, result = []) { - arr.forEach((val) => { - if (Array.isArray(val)) { - flatten(val, result); - } else { - result.push(val); - } - }); - return result; -} - -let input = [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; -console.log(flatten(input)); // [1, { a: [2, [3]]}, 4, 5, 6, 7, "hi", 8, 9, 10] - -function flattenIterative(out) { - // iteratively - let result = out; - while (result.some(Array.isArray)) { - result = [].concat.apply([], result); - } - return result; -} -var list1 = [ - [0, 1], - [2, 3], - [4, 5], -]; -console.log(flattenIterative(list1)); // [0, 1, 2, 3, 4, 5] - -function flattenIterative1(current) { - let result = []; - while (current.length) { - let firstValue = current.shift(); - if (Array.isArray(firstValue)) { - current = firstValue.concat(current); - } else { - result.push(firstValue); - } - } - return result; +function countCharacters(str) { + return str + .replace(/ /g, "") + .toLowerCase() + .split("") + .reduce((p, c) => { + if (c in p) { + p[c]++; + } else { + p[c] = 1; + } + return p; + }, {}); } - -let input = [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; -console.log(flattenIterative1(input)); -var list2 = [0, [1, [2, [3, [4, [5]]]]]]; -console.log(flattenIterative1(list2)); // [0, 1, 2, 3, 4, 5] +console.log(countCharacters("the brown fox jumps over the lazy dog")); ```
↥ back to top
-## Q. ***Find max difference between two number in Array*** +## Q. write a script that return the number of occurrences of a character in paragraph ```javascript -function maxDifference(arr) { - let maxDiff = 0; - - for (let i = 0; i < arr.length; i++) { - for (let j = i + 1; j < arr.length; j++) { - let diff = Math.abs(arr[i] - arr[j]); - maxDiff = Math.max(maxDiff, diff); +function charCount(str, searchChar) { + let count = 0; + if (str) { + let stripStr = str.replace(/ /g, "").toLowerCase(); //remove spaces and covert to lowercase + for (let chr of stripStr) { + if (chr === searchChar) { + count++; + } } } - return maxDiff; + return count; } - -console.log(maxDifference([1, 2, 4])); // [1 - 4 ] = 3 -``` - -## Q. ***swap two number in ES6 [destructing]*** - -```javascript -let a = 10, - b = 5; -[a, b] = [b, a]; +console.log(charCount("the brown fox jumps over the lazy dog", "o")); ```
↥ back to top
-## Q. ***Panagram ? it means all the 26 letters of alphabet are there*** +## Q. Recursive and non-recursive Factorial function ```javascript -function panagram(input) { - if (input == null) { - // Check for null and undefined - return false; +function recursiveFactorial(n) { + if (n < 1) { + throw Error("Value of N has to be greater then 1"); + } + if (n === 1) { + return 1; + } else { + return n * recursiveFactorial(n - 1); } +} - if (input.length < 26) { - // if length is less then 26 then it is not - return false; +console.log(recursiveFactorial(5)); + +function factorial(n) { + if (n < 1) { + throw Error("Value of N has to be greater then 1"); } - input = input.replace(/ /g, "").toLowerCase().split(""); - let obj = input.reduce((prev, current) => { - if (!(current in prev)) { - prev[current] = current; - } - return prev; - }, {}); - console.log(Object.keys(obj).length === 26 ? "panagram" : "not pangram"); + if (n === 1) { + return 1; + } + let result = 1; + for (let i = 1; i <= n; i++) { + result = result * i; + } + return result; } -processData("We promptly judged antique ivory buckles for the next prize"); // pangram -processData("We promptly judged antique ivory buckles for the prize"); // Not Pangram + +console.log(factorial(5)); ```
↥ back to top
-## Q. ***Given two identical DOM trees (not the same one), and a node from one of them find the node in the other one.*** +## Q. Recursive and non recursive fibonacci-sequence ```javascript -function indexOf(arrLike, target) { - return Array.prototype.indexOf.call(arrLike, target); -} +// 1, 1, 2, 3, 5, 8, 13, 21, 34 -// Given a node and a tree, extract the nodes path -function getPath(root, target) { - var current = target; - var path = []; - while (current !== root) { - let parentNode = current.parentNode; - path.unshift(indexOf(parentNode.childNodes, current)); - current = parentNode; +function recursiveFibonacci(num) { + if (num <= 1) { + return 1; + } else { + return recursiveFibonacci(num - 1) + recursiveFibonacci(num - 2); } - return path; } -// Given a tree and a path, let's locate a node -function locateNodeFromPath(node, path) { - return path.reduce((root, index) => root.childNodes[index], node); -} - -const rootA = document.querySelector("#root-a"); -const rootB = document.querySelector("#root-b"); -const target = rootA.querySelector(".person__age"); +console.log(recursiveFibonacci(8)); -console.log(locateNodeFromPath(rootB, getPath(rootA, target))); -``` +function fibonnaci(num) { + let a = 1, + b = 0, + temp; + while (num >= 0) { + temp = a; + a = a + b; + b = temp; + num--; + } + return b; +} -
- ↥ back to top -
+console.log(fibonnaci(7)); -## Q. ***Convert a number into a Roman Numeral*** +// Memoization fibonnaci -```javascript -function romanize(num) { - let lookup = { - M: 1000, - CM: 900, - D: 500, - CD: 400, - C: 100, - XC: 90, - L: 50, - XL: 40, - X: 10, - IX: 9, - V: 5, - IV: 4, - I: 1, - }, - roman = ""; - for (let i in lookup) { - while (num >= lookup[i]) { - roman += i; - num -= lookup[i]; - } +function fibonnaci(num, memo = {}) { + if (num in memo) { + return memo[num]; + } + if (num <= 1) { + return 1; } - return roman; + return (memo[num] = fibonnaci(num - 1, memo) + fibonnaci(num - 2, memo)); } -console.log(romanize(3)); // III +console.log(fibonnaci(5)); // 8 +``` + +## Q. Random Number between min and max + +```javascript +// 5 to 7 +let min = 5; +let max = 7; +console.log(min + Math.floor(Math.random() * (max - min + 1))); ```
↥ back to top
-## Q. ***check if parenthesis is malformed or not*** +## Q. Get HTML form values as JSON object ```javascript -function matchParenthesis(str) { - let obj = { "{": "}", "(": ")", "[": "]" }; - let result = []; - for (let s of str) { - if (s === "{" || s === "(" || s === "[") { - // All opening brackets - result.push(s); - } else { - if (result.length > 0) { - let lastValue = result.pop(); //pop the last value and compare with key - if (obj[lastValue] !== s) { - // if it is not same then it is not formated properly - return false; - } - } else { - return false; // empty array, there is nothing to pop. so it is not formated properly - } - } - } - return result.length === 0; -} +// Use the array reduce function with form elements. +const formToJSON = (elements) => + [].reduce.call( + elements, + (data, element) => { + data[element.name] = element.value; + // Check if name and value exist on element + // Check if it checkbox or radio button which can select multiple or single + //check for multiple select options + return data; + }, + {} + ); -console.log(matchParenthesis("}{{}}"), matchParenthesis("{{[]}}")); // false - true +// pass the elements to above method, to get values +document.querySelector("HTML_FORM_CLASS").elements; ```
↥ back to top
-## Q. ***Create Custom Event Emitter class*** +## Q. Reverse the number ```javascript -class EventEmitter { - constructor() { - this.holder = {}; - } - - on(eventName, fn) { - if (eventName && typeof fn === "function") { - this.holder[eventName] = this.holder[eventName] || []; - this.holder[eventName].push(fn); - } - } - - emit(eventName, ...args) { - let eventColl = this.holder[eventName]; - if (eventColl) { - eventColl.forEach((callback) => callback(args)); - } +function reverse(num) { + let result = 0; + while (num != 0) { + result = result * 10; + result = result + (num % 10); + num = Math.floor(num / 10); } + return result; } -let e = new EventEmitter(); -e.on("callme", function (args) { - console.log(`you called me ${args}`); -}); -e.on("callme", function (args) { - console.log(`testing`); -}); - -e.emit("callme", ["a", "b"], { firstName: "umesh", lastName: "gohil" }); +console.log(reverse(12345)); ```
↥ back to top
-## Q. ***Max value from an array*** +## Q. Remove Duplicate elements from Array ```javascript -const arr = [-2, -3, 4, 3, 2, 1]; -Math.max(...arr); // Fastest +var arr = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; +function removeDuplicate() { + return ar.reduce((prev, current) => { + //Cannot use includes of array, since it is not supported by many browser + if (prev.indexOf(current) === -1) { + prev.push(current); + } + return prev; + }, []); +} +console.log(removeDuplicate(ar)); -Math.max.apply(Math, arr); // Slow +const removeDuplicates = (arr) => { + let holder = {}; + return arr.filter((el) => { + if (!holder[el]) { + holder[el] = true; + return true; + } + return false; + }); +}; +const arr = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; +console.log(removeDuplicates(arr)); // ["1", "2", "3", "5", "8", "9"] // O(n) + +// Es6 +console.log([...new Set(arr)]); ```
↥ back to top
-## Q. ***DOM methods*** +## Q. Deep copy of object or clone of object ```javascript -https://github.com/nefe/You-Dont-Need-jQuery - -var el = document.querySelector('div'); -el.childNodes; // get the list of child nodes of el -el.firstChild; // get the first child node of el -el.lastChild; // get the last child node of el -el.parentNode; // get the parent node of el -el.previousSibling; // get the previous sibling of el -el.nextSibling; // get the next sibling of el -el.textContent; // get the text content of el -el.innerHTML; // get the inner html of el - -document.createElement('div') // create dom element -document.creatTextNode('Hello world'); // create text node -document.createDocumentFragment(); - -el.appendChild(); //append child to el; -el.insertBefore(); // insert child before el; -el.parentNode.replaceChild(NEW_NODE, REPLACE_ME) // replace the node -el.removechild(); // remove the child node - -Array.from(NODES) // convert nodelist to regular array +function deepExtend(out = {}) { + for (let i = 1; i < arguments.length; i++) { + let obj = arguments[i]; + if (obj == null) + // skip undefined and null [check with double equal not triple] + continue; -el.classList[contains | add | remove | replace] // class of el + obj = Object(obj); -el.dataset. // data-count is dataset.count, data-index-number is dataset.indexNumber + for (let key in obj) { + // avoid shadow hasownproperty of parent + if (Object.prototype.hasOwnProperty.call(obj, key)) { + if ( + typeof obj[key] === "object" && + !Array.isArray(obj[key]) && + obj[key] != null + ) + out[key] = deepExtend(out[key], obj[key]); + else out[key] = obj[key]; + } + } + } + return out; +} -el.setAttribute | el.getAttribute | el.removeAttribute // attributes of el +//Alternative if there are no function +let cloneObj = JSON.parse(JSON.stringify(obj)); -el.style // get the style of el +console.log(deepExtend({}, { a: 1, b: { c: 2, d: 3 } }, { e: 4, b: { f: 1 } })); +//output : { a: 1, b: {c: 2, d: 3, f: 1}, e: 4 } ```
↥ back to top
-## Q. ***search function called after 500 ms*** +## Q. Sort ticket based on flying order. ```javascript -; +"use strict"; -let timer = null; -function searchOptions(value) { - clearTimeout(timer); - timer = setTimeout(() => { - console.log(`value is - ${value}`); - }, 500); +function SortTickets(tickets) { + this.tickets = tickets; + + // reverse the order of tickets + this.reverseTickets = {}; + for (let key in this.tickets) { + this.reverseTickets[tickets[key]] = key; + } + + // Get the starting point of ticket + let orderedTivckets = [...this.getStartingPoint()]; + + // Get the ticket destination. + let currentValue = orderedTickets[orderedTickets.length - 1]; + while (currentValue) { + currentValue = this.tickets[currentValue]; + if (currentValue) { + orderedTickets.push(currentValue); + } + } + console.log(orderedTickets); } -let search = document.querySelector(".search"); -search.addEventListener("keyup", function () { - searchOptions(this.value); +SortTickets.prototype.getStartingPoint = function () { + for (let tick in this.tickets) { + if (!(tick in this.reverseTickets)) { + return [tick, this.tickets[tick]]; + } + } + return null; +}; + +new SortTickets({ + Athens: "Rio", + Barcelona: "Athens", + London: "NYC", + ND: "Lahore", + NYC: "Barcelona", + Rio: "ND", }); ``` @@ -4422,3925 +4264,4156 @@ search.addEventListener("keyup", function () { ↥ back to top -## Q. ***Move all zero's to end*** +## Q. Cuncurrent execute function based on input number ```javascript -const moveZeroToEnd = (arr) => { - for (let i = 0, j = 0; j < arr.length; j++) { - if (arr[j] !== 0) { - if (i < j) { - [arr[i], arr[j]] = [arr[j], arr[i]]; // swap i and j - } - i++; +function concurrent(num) { + this.queue = []; + this.num = num; +} + +concurrent.prototype.enqueue = function (value) { + this.queue.push(value); +}; + +concurrent.prototype.start = function () { + this.runningCount = 0; + while (this.queue.length > 0) { + if (this.runningCount < this.num) { + this.queue.pop().call(this, () => { + this.runningCount--; + let count = this.runningCount; + if (count === 0) { + this.start(); + } + }); + this.runningCount++; } } - return arr; }; -console.log(moveZeroToEnd([1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0])); // [1, 8, 2, 3, 4, 5, 0, 0, 0, 0, 0] +let callback = (done) => { + console.log("starting"); + setTimeout(() => { + console.log("stopped"); + done(); + }, 200); +}; + +let c = new concurrent(2); +c.enqueue(callback); +c.enqueue(callback); +c.enqueue(callback); +c.enqueue(callback); +c.enqueue(callback); +c.enqueue(callback); +c.start(); ```
↥ back to top
-## Q. ***Decode message in matrix [diagional down right, diagional up right]*** +## Q. Reversing an array ```javascript -const decodeMessage = (mat) => { - // check if matrix is null or empty - if (mat == null || mat.length === 0) { - return ""; - } - let x = mat.length - 1; - let y = mat[0].length - 1; - let message = ""; - let decode = (mat, i = 0, j = 0, direction = "DOWN") => { - message += mat[i][j]; +let a = [1, 2, 3, 4, 5]; - if (i === x) { - direction = "UP"; - } +//Approach 1: +console.log(a.reverse()); - if (direction === "DOWN") { - i++; - } else { - i--; - } +//Approach 2: +let reverse = a.reduce((prev, current) => { + prev.unshift(current); + return prev; +}, []); - if (j === y) { - return; - } +console.log(reverse); +``` - j++; - decode(mat, i, j, direction); - }; - decode(mat); - return message; -}; +## Q. Rotate 2D array -let mat = [ - ["I", "B", "C", "A", "L", "K", "A"], - ["D", "R", "F", "C", "A", "E", "A"], - ["G", "H", "O", "E", "L", "A", "D"], - ["G", "H", "O", "E", "L", "A", "D"], -]; +```javascript +const transpose = (arr) => arr[0].map((col, i) => arr.map((row) => row[i])); -console.log(decodeMessage(mat)); //IROELEA +console.log( + transpose([ + [1, 2, 3, 4], + [5, 6, 7, 8], + [9, 10, 11, 12], + ]) +); ``` -
- ↥ back to top -
- -## Q. ***find a pair in array, whose sum is equal to given number.*** +## Q. Get Column from 2D Array ```javascript -const hasPairSum = (arr, sum) => { - if (arr == null && arr.length < 2) { - return false; - } +const getColumn = (arr, n) => arr.map((x) => x[n]); - let left = 0; - let right = arr.length - 1; - let result = false; +const twoDimensionalArray = [ + [1, 2, 3], + [4, 5, 6], + [7, 8, 9], +]; - while (left < right && !result) { - let pairSum = arr[left] + arr[right]; - if (pairSum < sum) { - left++; - } else if (pairSum > sum) { - right--; - } else { - result = true; - } - } - return result; -}; +console.log(getColumn(twoDimensionalArray, 1)); //Result = [2,5,8] +``` -console.log(hasPairSum([1, 2, 4, 5], 8)); // null -console.log(hasPairSum([1, 2, 4, 4], 8)); // [2,3] +## Q. Get top N from array -const hasPairSum = (arr, sum) => { - let difference = {}; - let hasPair = false; - arr.forEach((item) => { - let diff = sum - item; - if (!difference[diff]) { - difference[item] = true; - } else { - hasPair = true; - } - }); - return hasPair; -}; -console.log(hasPairSum([6, 4, 3, 8], 8)); +```javascript +function topN(arr, num) { + let sorted = arr.sort((a, b) => a - b); + return sorted.slice(sorted.length - num, sorted.length); +} -// NOTE: if array is not sorted then subtract the value with sum and store in difference -// then see if that value exist in difference then return true. +console.log(topN([1, 8, 3, 4, 5], 2)); // [5,8] ```
↥ back to top
-## Q. ***Binary Search [Array should be sorted]*** +## Q. Get query params from Object ```javascript -function binarySearch(arr, val) { - let startIndex = 0, - stopIndex = arr.length - 1, - middleIndex = Math.floor((startIndex + stopIndex) / 2); - - while (arr[middleIndex] !== val && startIndex < stopIndex) { - if (val < arr[middleIndex]) { - stopIndex = middleIndex - 1; - } else if (val > arr[middleIndex]) { - startIndex = middleIndex + 1; +function getQueryParams(obj) { + let parms = ""; + for (let key in obj) { + if (obj.hasOwnProperty(key)) { + if (parms.length > 0) { + parms += "&"; + } + parms += encodeURI(`${key}=${obj[key]}`); } - middleIndex = Math.floor((startIndex + stopIndex) / 2); } - - return arr[middleIndex] === val ? middleIndex : -1; + return parms; } -console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 22)); -console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 27)); +console.log( + getQueryParams({ + name: "Umesh", + tel: "48289", + add: "3333 emearld st", + }) +); ```
↥ back to top
-## Q. ***Pascal triangle.*** +## Q. Consecutive 1's in binary ```javascript -function pascalTriangle(n) { - let last = [1], - triangle = [last]; - for (let i = 0; i < n; i++) { - const ls = [0].concat(last), //[0,1] // [0,1,1] - rs = last.concat([0]); //[1,0] // [1,1,0] - last = rs.map((r, i) => ls[i] + r); //[1, 1] // [1,2,1] - triangle = triangle.concat([last]); // [[1], [1,1]] // [1], [1, 1], [1, 2, 1] +function consecutiveOne(num) { + let binaryArray = num.toString(2); + + let maxOccurence = 0, + occurence = 0; + for (let val of binaryArray) { + if (val === "1") { + occurence += 1; + maxOccurence = Math.max(maxOccurence, occurence); + } else { + occurence = 0; + } } - return triangle; + return maxOccurence; } - -console.log(pascalTriangle(2)); +//13 = 1101 = 2 +//5 = 101 = 1 +console.log(consecutiveOne(5)); //1 ```
↥ back to top
-## Q. ***Explain the code below. How many times the createVal function is called?*** +## Q. Spiral travesal of matrix ```javascript -function createVal() { - return Math.random(); -} +var input = [ + [1, 2, 3, 4], + [5, 6, 7, 8], + [9, 10, 11, 12], + [13, 14, 15, 16], +]; -function fun(val = createVal()) { - console.log(val); -} +var spiralTraversal = function (matriks) { + let result = []; + var goAround = function (matrix) { + if (matrix.length === 0) { + return; + } -fun(); -fun(5); -``` + // right + result = result.concat(matrix.shift()); -`createVal()` function will execute only once. + // down + for (var j = 0; j < matrix.length - 1; j++) { + result.push(matrix[j].pop()); + } -Output + // bottom + result = result.concat(matrix.pop().reverse()); -``` -0.2162050091554224 -VM298:6 5 + // up + for (var k = matrix.length - 1; k > 0; k--) { + result.push(matrix[k].shift()); + } + + return goAround(matrix); + }; + + goAround(matriks); + + return result; +}; +console.log(spiralTraversal(input)); // [1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10] ```
↥ back to top
-## Q. ***What is the output?*** +## Q. Merge Sorted array and sort it. ```javascript -function sayHi() { - console.log(name); - console.log(age); - var name = "Lydia"; - let age = 21; +function mergeSortedArray(arr1, arr2) { + return [...new Set(arr1.concat(arr2))].sort((a, b) => a - b); } -sayHi(); +console.log(mergeSortedArray([1, 2, 3, 4, 5, 6], [0, 3, 4, 7])); // [0, 1, 2, 3, 4, 5, 6, 7] ``` -- A: `Lydia` and `undefined` -- B: `Lydia` and `ReferenceError` -- C: `ReferenceError` and `21` -- D: `undefined` and `ReferenceError` +
+ ↥ back to top +
-**Answer: D** +## Q. Anagram of words -Within the function, we first declare the `name` variable with the `var` keyword. This means that the variable gets hoisted (memory space is set up during the creation phase) with the default value of `undefined`, until we actually get to the line where we define the variable. We haven't defined the variable yet on the line where we try to log the `name` variable, so it still holds the value of `undefined`. +```javascript +const alphabetize = (word) => word.split("").sort().join(""); -Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don't get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`. +function groupAnagram(wordsArr) { + return wordsArr.reduce((p, c) => { + const sortedWord = alphabetize(c); + if (sortedWord in p) { + p[sortedWord].push(c); + } else { + p[sortedWord] = [c]; + } + return p; + }, {}); +} + +console.log( + groupAnagram(["map", "art", "how", "rat", "tar", "who", "pam", "shoop"]) +); +// result : { +// amp: ["map", "pam"], +// art: ["art", "rat", "tar"], +// hoops: ["shoop"], +// how: ["how", "who"] +// } +```
↥ back to top
-## Q. ***What is the output?*** +## Q. Print the largest (maximum) hourglass sum found in 2d array. ```javascript -for (var i = 0; i < 3; i++) { - setTimeout(() => console.log(i), 1); -} +// if arr 6 X 6 then iterate it till 4 X 4 [reduce by two] +// if arr 8 X 8 then iterate it till 6 X 6 [reduce by two] +function main(arr) { + let maxScore = -999; + let len = arr.length; + for (let i = 0; i < len - 2; i++) { + for (let j = 0; j < len - 2; j++) { + let total = + arr[i][j] + + arr[i][j + 1] + + arr[i][j + 2] + + arr[i + 1][j + 1] + + arr[i + 2][j] + + arr[i + 2][j + 1] + + arr[i + 2][j + 2]; -for (let i = 0; i < 3; i++) { - setTimeout(() => console.log(i), 1); + maxScore = Math.max(maxScore, total); + } + } + console.log(maxScore); } ``` -- A: `0 1 2` and `0 1 2` -- B: `0 1 2` and `3 3 3` -- C: `3 3 3` and `0 1 2` - -**Answer: C** - -Because of the event queue in JavaScript, the `setTimeout` callback function is called _after_ the loop has been executed. Since the variable `i` in the first loop was declared using the `var` keyword, this value was global. During the loop, we incremented the value of `i` by `1` each time, using the unary operator `++`. By the time the `setTimeout` callback function was invoked, `i` was equal to `3` in the first example. - -In the second loop, the variable `i` was declared using the `let` keyword: variables declared with the `let` (and `const`) keyword are block-scoped (a block is anything between `{ }`). During each iteration, `i` will have a new value, and each value is scoped inside the loop. -
↥ back to top
-## Q. ***What is the output?*** +## Q. Transform array of object to array ```javascript -const shape = { - radius: 10, - diameter() { - return this.radius * 2; - }, - perimeter: () => 2 * Math.PI * this.radius, -}; - -console.log(shape.diameter()); -console.log(shape.perimeter()); -``` - -- A: `20` and `62.83185307179586` -- B: `20` and `NaN` -- C: `20` and `63` -- D: `NaN` and `63` - -**Answer: B** +let data = [ + { vid: "aaa", san: 12 }, + { vid: "aaa", san: 18 }, + { vid: "aaa", san: 2 }, + { vid: "bbb", san: 33 }, + { vid: "bbb", san: 44 }, + { vid: "aaa", san: 100 }, +]; -Note that the value of `diameter` is a regular function, whereas the value of `perimeter` is an arrow function. +let newData = data.reduce((acc, item) => { + acc[item.vid] = acc[item.vid] || { vid: item.vid, san: [] }; + acc[item.vid]["san"].push(item.san); + return acc; +}, {}); -With arrow functions, the `this` keyword refers to its current surrounding scope, unlike regular functions! This means that when we call `perimeter`, it doesn't refer to the shape object, but to its surrounding scope (window for example). +console.log(Object.keys(newData).map((key) => newData[key])); -There is no value `radius` on that object, which returns `undefined`. +// Result +// [[object Object] { +// san: [12, 18, 2, 100], +// vid: "aaa" +// }, [object Object] { +// san: [33, 44], +// vid: "bbb" +// }] +```
↥ back to top
-## Q. ***What is the output?*** +## Q. Create a private variable or private method in object ```javascript -+true; -!"Lydia"; -``` - -- A: `1` and `false` -- B: `false` and `NaN` -- C: `false` and `false` - -**Answer: A** - -The unary plus tries to convert an operand to a number. `true` is `1`, and `false` is `0`. +let obj = (function () { + function getPrivateFunction() { + console.log("this is private function"); + } + let p = "You are accessing private variable"; + return { + getPrivateProperty: () => { + console.log(p); + }, + callPrivateFunction: getPrivateFunction, + }; +})(); -The string `'Lydia'` is a truthy value. What we're actually asking, is "is this truthy value falsy?". This returns `false`. +obj.getPrivateValue(); // You are accessing private variable +console.log("p" in obj); // false +obj.callPrivateFunction(); // this is private function +```
↥ back to top
-## Q. ***Which one is true?*** +## Q. Flatten only Array not objects ```javascript -const bird = { - size: "small", -}; - -const mouse = { - name: "Mickey", - small: true, -}; -``` - -- A: `mouse.bird.size` is not valid -- B: `mouse[bird.size]` is not valid -- C: `mouse[bird["size"]]` is not valid -- D: All of them are valid - -**Answer: A** +function flatten(arr, result = []) { + arr.forEach((val) => { + if (Array.isArray(val)) { + flatten(val, result); + } else { + result.push(val); + } + }); + return result; +} -In JavaScript, all object keys are strings (unless it's a Symbol). Even though we might not _type_ them as strings, they are always converted into strings under the hood. +let input = [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; +console.log(flatten(input)); // [1, { a: [2, [3]]}, 4, 5, 6, 7, "hi", 8, 9, 10] -JavaScript interprets (or unboxes) statements. When we use bracket notation, it sees the first opening bracket `[` and keeps going until it finds the closing bracket `]`. Only then, it will evaluate the statement. +function flattenIterative(out) { + // iteratively + let result = out; + while (result.some(Array.isArray)) { + result = [].concat.apply([], result); + } + return result; +} +var list1 = [ + [0, 1], + [2, 3], + [4, 5], +]; +console.log(flattenIterative(list1)); // [0, 1, 2, 3, 4, 5] -`mouse[bird.size]`: First it evaluates `bird.size`, which is `"small"`. `mouse["small"]` returns `true` +function flattenIterative1(current) { + let result = []; + while (current.length) { + let firstValue = current.shift(); + if (Array.isArray(firstValue)) { + current = firstValue.concat(current); + } else { + result.push(firstValue); + } + } + return result; +} -However, with dot notation, this doesn't happen. `mouse` does not have a key called `bird`, which means that `mouse.bird` is `undefined`. Then, we ask for the `size` using dot notation: `mouse.bird.size`. Since `mouse.bird` is `undefined`, we're actually asking `undefined.size`. This isn't valid, and will throw an error similar to `Cannot read property "size" of undefined`. +let input = [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; +console.log(flattenIterative1(input)); +var list2 = [0, [1, [2, [3, [4, [5]]]]]]; +console.log(flattenIterative1(list2)); // [0, 1, 2, 3, 4, 5] +```
↥ back to top
-## Q. ***What is the output?*** +## Q. Find max difference between two number in Array ```javascript -let c = { greeting: "Hey!" }; -let d; +function maxDifference(arr) { + let maxDiff = 0; -d = c; -c.greeting = "Hello"; -console.log(d.greeting); + for (let i = 0; i < arr.length; i++) { + for (let j = i + 1; j < arr.length; j++) { + let diff = Math.abs(arr[i] - arr[j]); + maxDiff = Math.max(maxDiff, diff); + } + } + return maxDiff; +} + +console.log(maxDifference([1, 2, 4])); // [1 - 4 ] = 3 ``` -- A: `Hello` -- B: `Hey!` -- C: `undefined` -- D: `ReferenceError` -- E: `TypeError` +## Q. swap two number in ES6 [destructing] -**Answer: A** +```javascript +let a = 10, + b = 5; +[a, b] = [b, a]; +``` -In JavaScript, all objects interact by _reference_ when setting them equal to each other. +
+ ↥ back to top +
-First, variable `c` holds a value to an object. Later, we assign `d` with the same reference that `c` has to the object. +## Q. Panagram ? it means all the 26 letters of alphabet are there - +```javascript +function panagram(input) { + if (input == null) { + // Check for null and undefined + return false; + } -When you change one object, you change all of them. + if (input.length < 26) { + // if length is less then 26 then it is not + return false; + } + input = input.replace(/ /g, "").toLowerCase().split(""); + let obj = input.reduce((prev, current) => { + if (!(current in prev)) { + prev[current] = current; + } + return prev; + }, {}); + console.log(Object.keys(obj).length === 26 ? "panagram" : "not pangram"); +} +processData("We promptly judged antique ivory buckles for the next prize"); // pangram +processData("We promptly judged antique ivory buckles for the prize"); // Not Pangram +```
↥ back to top
-## Q. ***What is the output?*** +## Q. Given two identical DOM trees (not the same one), and a node from one of them find the node in the other one. ```javascript -let a = 3; -let b = new Number(3); -let c = 3; - -console.log(a == b); -console.log(a === b); -console.log(b === c); -``` - -- A: `true` `false` `true` -- B: `false` `false` `true` -- C: `true` `false` `false` -- D: `false` `true` `true` +function indexOf(arrLike, target) { + return Array.prototype.indexOf.call(arrLike, target); +} -**Answer: C** +// Given a node and a tree, extract the nodes path +function getPath(root, target) { + var current = target; + var path = []; + while (current !== root) { + let parentNode = current.parentNode; + path.unshift(indexOf(parentNode.childNodes, current)); + current = parentNode; + } + return path; +} -`new Number()` is a built-in function constructor. Although it looks like a number, it's not really a number: it has a bunch of extra features and is an object. +// Given a tree and a path, let's locate a node +function locateNodeFromPath(node, path) { + return path.reduce((root, index) => root.childNodes[index], node); +} -When we use the `==` operator, it only checks whether it has the same _value_. They both have the value of `3`, so it returns `true`. +const rootA = document.querySelector("#root-a"); +const rootB = document.querySelector("#root-b"); +const target = rootA.querySelector(".person__age"); -However, when we use the `===` operator, both value _and_ type should be the same. It's not: `new Number()` is not a number, it's an **object**. Both return `false.` +console.log(locateNodeFromPath(rootB, getPath(rootA, target))); +```
↥ back to top
-## Q. ***What is the output?*** +## Q. Convert a number into a Roman Numeral ```javascript -class Chameleon { - static colorChange(newColor) { - this.newColor = newColor; - return this.newColor; - } - - constructor({ newColor = "green" } = {}) { - this.newColor = newColor; +function romanize(num) { + let lookup = { + M: 1000, + CM: 900, + D: 500, + CD: 400, + C: 100, + XC: 90, + L: 50, + XL: 40, + X: 10, + IX: 9, + V: 5, + IV: 4, + I: 1, + }, + roman = ""; + for (let i in lookup) { + while (num >= lookup[i]) { + roman += i; + num -= lookup[i]; + } } + return roman; } -const freddie = new Chameleon({ newColor: "purple" }); -console.log(freddie.colorChange("orange")); +console.log(romanize(3)); // III ``` -- A: `orange` -- B: `purple` -- C: `green` -- D: `TypeError` +
+ ↥ back to top +
-**Answer: D** +## Q. check if parenthesis is malformed or not -The `colorChange` function is static. Static methods are designed to live only on the constructor in which they are created, and cannot be passed down to any children. Since `freddie` is a child, the function is not passed down, and not available on the `freddie` instance: a `TypeError` is thrown. +```javascript +function matchParenthesis(str) { + let obj = { "{": "}", "(": ")", "[": "]" }; + let result = []; + for (let s of str) { + if (s === "{" || s === "(" || s === "[") { + // All opening brackets + result.push(s); + } else { + if (result.length > 0) { + let lastValue = result.pop(); //pop the last value and compare with key + if (obj[lastValue] !== s) { + // if it is not same then it is not formated properly + return false; + } + } else { + return false; // empty array, there is nothing to pop. so it is not formated properly + } + } + } + return result.length === 0; +} + +console.log(matchParenthesis("}{{}}"), matchParenthesis("{{[]}}")); // false - true +```
↥ back to top
-## Q. ***What is the output?*** +## Q. Create Custom Event Emitter class ```javascript -let greeting; -greetign = {}; // Typo! -console.log(greetign); -``` +class EventEmitter { + constructor() { + this.holder = {}; + } -- A: `{}` -- B: `ReferenceError: greetign is not defined` -- C: `undefined` + on(eventName, fn) { + if (eventName && typeof fn === "function") { + this.holder[eventName] = this.holder[eventName] || []; + this.holder[eventName].push(fn); + } + } -**Answer: A** + emit(eventName, ...args) { + let eventColl = this.holder[eventName]; + if (eventColl) { + eventColl.forEach((callback) => callback(args)); + } + } +} -It logs the object, because we just created an empty object on the global object! When we mistyped `greeting` as `greetign`, the JS interpreter actually saw this as `global.greetign = {}` (or `window.greetign = {}` in a browser). +let e = new EventEmitter(); +e.on("callme", function (args) { + console.log(`you called me ${args}`); +}); +e.on("callme", function (args) { + console.log(`testing`); +}); -In order to avoid this, we can use `"use strict"`. This makes sure that you have declared a variable before setting it equal to anything. +e.emit("callme", ["a", "b"], { firstName: "umesh", lastName: "gohil" }); +```
↥ back to top
-## Q. ***What happens when we do this?*** +## Q. Max value from an array ```javascript -function bark() { - console.log("Woof!"); -} +const arr = [-2, -3, 4, 3, 2, 1]; +Math.max(...arr); // Fastest -bark.animal = "dog"; +Math.max.apply(Math, arr); // Slow ``` -- A: Nothing, this is totally fine! -- B: `SyntaxError`. You cannot add properties to a function this way. -- C: `"Woof"` gets logged. -- D: `ReferenceError` - -**Answer: A** - -This is possible in JavaScript, because functions are objects! (Everything besides primitive types are objects) - -A function is a special type of object. The code you write yourself isn't the actual function. The function is an object with properties. This property is invocable. -
↥ back to top
-## Q. ***What is the output?*** +## Q. DOM methods ```javascript -function Person(firstName, lastName) { - this.firstName = firstName; - this.lastName = lastName; -} +https://github.com/nefe/You-Dont-Need-jQuery -const member = new Person("Lydia", "Hallie"); -Person.getFullName = function () { - return `${this.firstName} ${this.lastName}`; -}; +var el = document.querySelector('div'); +el.childNodes; // get the list of child nodes of el +el.firstChild; // get the first child node of el +el.lastChild; // get the last child node of el +el.parentNode; // get the parent node of el +el.previousSibling; // get the previous sibling of el +el.nextSibling; // get the next sibling of el +el.textContent; // get the text content of el +el.innerHTML; // get the inner html of el -console.log(member.getFullName()); -``` +document.createElement('div') // create dom element +document.creatTextNode('Hello world'); // create text node +document.createDocumentFragment(); -- A: `TypeError` -- B: `SyntaxError` -- C: `Lydia Hallie` -- D: `undefined` `undefined` +el.appendChild(); //append child to el; +el.insertBefore(); // insert child before el; +el.parentNode.replaceChild(NEW_NODE, REPLACE_ME) // replace the node +el.removechild(); // remove the child node -**Answer: A** +Array.from(NODES) // convert nodelist to regular array -You can't add properties to a constructor like you can with regular objects. If you want to add a feature to all objects at once, you have to use the prototype instead. So in this case, +el.classList[contains | add | remove | replace] // class of el -```js -Person.prototype.getFullName = function () { - return `${this.firstName} ${this.lastName}`; -}; -``` +el.dataset. // data-count is dataset.count, data-index-number is dataset.indexNumber -would have made `member.getFullName()` work. Why is this beneficial? Say that we added this method to the constructor itself. Maybe not every `Person` instance needed this method. This would waste a lot of memory space, since they would still have that property, which takes of memory space for each instance. Instead, if we only add it to the prototype, we just have it at one spot in memory, yet they all have access to it! +el.setAttribute | el.getAttribute | el.removeAttribute // attributes of el + +el.style // get the style of el +``` -## Q. ***What is the output?*** +## Q. search function called after 500 ms ```javascript -function Person(firstName, lastName) { - this.firstName = firstName; - this.lastName = lastName; -} +; -const lydia = new Person("Lydia", "Hallie"); -const sarah = Person("Sarah", "Smith"); +let timer = null; +function searchOptions(value) { + clearTimeout(timer); + timer = setTimeout(() => { + console.log(`value is - ${value}`); + }, 500); +} -console.log(lydia); -console.log(sarah); +let search = document.querySelector(".search"); +search.addEventListener("keyup", function () { + searchOptions(this.value); +}); ``` -- A: `Person {firstName: "Lydia", lastName: "Hallie"}` and `undefined` -- B: `Person {firstName: "Lydia", lastName: "Hallie"}` and `Person {firstName: "Sarah", lastName: "Smith"}` -- C: `Person {firstName: "Lydia", lastName: "Hallie"}` and `{}` -- D:`Person {firstName: "Lydia", lastName: "Hallie"}` and `ReferenceError` + -**Answer: A** +## Q. Move all zero's to end -For `sarah`, we didn't use the `new` keyword. When using `new`, it refers to the new empty object we create. However, if you don't add `new` it refers to the **global object**! +```javascript +const moveZeroToEnd = (arr) => { + for (let i = 0, j = 0; j < arr.length; j++) { + if (arr[j] !== 0) { + if (i < j) { + [arr[i], arr[j]] = [arr[j], arr[i]]; // swap i and j + } + i++; + } + } + return arr; +}; -We said that `this.firstName` equals `"Sarah"` and `this.lastName` equals `"Smith"`. What we actually did, is defining `global.firstName = 'Sarah'` and `global.lastName = 'Smith'`. `sarah` itself is left `undefined`, since we don't return a value from the `Person` function. +console.log(moveZeroToEnd([1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0])); // [1, 8, 2, 3, 4, 5, 0, 0, 0, 0, 0] +``` -## Q. ***What are the three phases of event propagation?*** - -- A: Target > Capturing > Bubbling -- B: Bubbling > Target > Capturing -- C: Target > Bubbling > Capturing -- D: Capturing > Target > Bubbling - -**Answer: D** +## Q. Decode message in matrix [diagional down right, diagional up right] -During the **capturing** phase, the event goes through the ancestor elements down to the target element. It then reaches the **target** element, and **bubbling** begins. +```javascript +const decodeMessage = (mat) => { + // check if matrix is null or empty + if (mat == null || mat.length === 0) { + return ""; + } + let x = mat.length - 1; + let y = mat[0].length - 1; + let message = ""; + let decode = (mat, i = 0, j = 0, direction = "DOWN") => { + message += mat[i][j]; - + if (i === x) { + direction = "UP"; + } - + if (direction === "DOWN") { + i++; + } else { + i--; + } -## Q. ***All object have prototypes.*** + if (j === y) { + return; + } -- A: true -- B: false + j++; + decode(mat, i, j, direction); + }; + decode(mat); + return message; +}; -**Answer: B** +let mat = [ + ["I", "B", "C", "A", "L", "K", "A"], + ["D", "R", "F", "C", "A", "E", "A"], + ["G", "H", "O", "E", "L", "A", "D"], + ["G", "H", "O", "E", "L", "A", "D"], +]; -All objects have prototypes, except for the **base object**. The base object is the object created by the user, or an object that is created using the `new` keyword. The base object has access to some methods and properties, such as `.toString`. This is the reason why you can use built-in JavaScript methods! All of such methods are available on the prototype. Although JavaScript can't find it directly on your object, it goes down the prototype chain and finds it there, which makes it accessible for you. +console.log(decodeMessage(mat)); //IROELEA +``` -## Q. ***What is the output?*** +## Q. find a pair in array, whose sum is equal to given number. ```javascript -function sum(a, b) { - return a + b; -} +const hasPairSum = (arr, sum) => { + if (arr == null && arr.length < 2) { + return false; + } -sum(1, "2"); -``` + let left = 0; + let right = arr.length - 1; + let result = false; -- A: `NaN` -- B: `TypeError` -- C: `"12"` -- D: `3` + while (left < right && !result) { + let pairSum = arr[left] + arr[right]; + if (pairSum < sum) { + left++; + } else if (pairSum > sum) { + right--; + } else { + result = true; + } + } + return result; +}; -**Answer: C** +console.log(hasPairSum([1, 2, 4, 5], 8)); // null +console.log(hasPairSum([1, 2, 4, 4], 8)); // [2,3] -JavaScript is a **dynamically typed language**: we don't specify what types certain variables are. Values can automatically be converted into another type without you knowing, which is called _implicit type coercion_. **Coercion** is converting from one type into another. +const hasPairSum = (arr, sum) => { + let difference = {}; + let hasPair = false; + arr.forEach((item) => { + let diff = sum - item; + if (!difference[diff]) { + difference[item] = true; + } else { + hasPair = true; + } + }); + return hasPair; +}; +console.log(hasPairSum([6, 4, 3, 8], 8)); -In this example, JavaScript converts the number `1` into a string, in order for the function to make sense and return a value. During the addition of a numeric type (`1`) and a string type (`'2'`), the number is treated as a string. We can concatenate strings like `"Hello" + "World"`, so What is happening here is `"1" + "2"` which returns `"12"`. +// NOTE: if array is not sorted then subtract the value with sum and store in difference +// then see if that value exist in difference then return true. +``` -## Q. ***What is the output?*** +## Q. Binary Search [Array should be sorted] ```javascript -let number = 0; -console.log(number++); -console.log(++number); -console.log(number); -``` +function binarySearch(arr, val) { + let startIndex = 0, + stopIndex = arr.length - 1, + middleIndex = Math.floor((startIndex + stopIndex) / 2); -- A: `1` `1` `2` -- B: `1` `2` `2` -- C: `0` `2` `2` -- D: `0` `1` `2` + while (arr[middleIndex] !== val && startIndex < stopIndex) { + if (val < arr[middleIndex]) { + stopIndex = middleIndex - 1; + } else if (val > arr[middleIndex]) { + startIndex = middleIndex + 1; + } + middleIndex = Math.floor((startIndex + stopIndex) / 2); + } -**Answer: C** + return arr[middleIndex] === val ? middleIndex : -1; +} -The **postfix** unary operator `++`: +console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 22)); +console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 27)); +``` -1. Returns the value (this returns `0`) -2. Increments the value (number is now `1`) + -The **prefix** unary operator `++`: +## Q. Pascal triangle. -1. Increments the value (number is now `2`) -2. Returns the value (this returns `2`) +```javascript +function pascalTriangle(n) { + let last = [1], + triangle = [last]; + for (let i = 0; i < n; i++) { + const ls = [0].concat(last), //[0,1] // [0,1,1] + rs = last.concat([0]); //[1,0] // [1,1,0] + last = rs.map((r, i) => ls[i] + r); //[1, 1] // [1,2,1] + triangle = triangle.concat([last]); // [[1], [1,1]] // [1], [1, 1], [1, 2, 1] + } + return triangle; +} -This returns `0 2 2`. +console.log(pascalTriangle(2)); +``` -## Q. ***What is the output?*** +## Q. Explain the code below. How many times the createVal function is called? ```javascript -function getPersonInfo(one, two, three) { - console.log(one); - console.log(two); - console.log(three); +function createVal() { + return Math.random(); } -const person = "Lydia"; -const age = 21; +function fun(val = createVal()) { + console.log(val); +} -getPersonInfo`${person} is ${age} years old`; +fun(); +fun(5); ``` -- A: `"Lydia"` `21` `["", " is ", " years old"]` -- B: `["", " is ", " years old"]` `"Lydia"` `21` -- C: `"Lydia"` `["", " is ", " years old"]` `21` +`createVal()` function will execute only once. -**Answer: B** +Output -If you use tagged template literals, the value of the first argument is always an array of the string values. The remaining arguments get the values of the passed expressions! +``` +0.2162050091554224 +VM298:6 5 +``` -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -function checkAge(data) { - if (data === { age: 18 }) { - console.log("You are an adult!"); - } else if (data == { age: 18 }) { - console.log("You are still an adult."); - } else { - console.log(`Hmm.. You don't have an age I guess`); - } +function sayHi() { + console.log(name); + console.log(age); + var name = "Lydia"; + let age = 21; } -checkAge({ age: 18 }); +sayHi(); ``` -- A: `You are an adult!` -- B: `You are still an adult.` -- C: `Hmm.. You don't have an age I guess` - -**Answer: C** +- A: `Lydia` and `undefined` +- B: `Lydia` and `ReferenceError` +- C: `ReferenceError` and `21` +- D: `undefined` and `ReferenceError` -When testing equality, primitives are compared by their _value_, while objects are compared by their _reference_. JavaScript checks if the objects have a reference to the same location in memory. +**Answer: D** -The two objects that we are comparing don't have that: the object we passed as a parameter refers to a different location in memory than the object we used in order to check equality. +Within the function, we first declare the `name` variable with the `var` keyword. This means that the variable gets hoisted (memory space is set up during the creation phase) with the default value of `undefined`, until we actually get to the line where we define the variable. We haven't defined the variable yet on the line where we try to log the `name` variable, so it still holds the value of `undefined`. -This is why both `{ age: 18 } === { age: 18 }` and `{ age: 18 } == { age: 18 }` return `false`. +Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don't get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -function getAge(...args) { - console.log(typeof args); +for (var i = 0; i < 3; i++) { + setTimeout(() => console.log(i), 1); } -getAge(21); +for (let i = 0; i < 3; i++) { + setTimeout(() => console.log(i), 1); +} ``` -- A: `"number"` -- B: `"array"` -- C: `"object"` -- D: `"NaN"` +- A: `0 1 2` and `0 1 2` +- B: `0 1 2` and `3 3 3` +- C: `3 3 3` and `0 1 2` **Answer: C** -The rest parameter (`...args`.) lets us "collect" all remaining arguments into an array. An array is an object, so `typeof args` returns `"object"` +Because of the event queue in JavaScript, the `setTimeout` callback function is called _after_ the loop has been executed. Since the variable `i` in the first loop was declared using the `var` keyword, this value was global. During the loop, we incremented the value of `i` by `1` each time, using the unary operator `++`. By the time the `setTimeout` callback function was invoked, `i` was equal to `3` in the first example. + +In the second loop, the variable `i` was declared using the `let` keyword: variables declared with the `let` (and `const`) keyword are block-scoped (a block is anything between `{ }`). During each iteration, `i` will have a new value, and each value is scoped inside the loop. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -function getAge() { - "use strict"; - age = 21; - console.log(age); -} +const shape = { + radius: 10, + diameter() { + return this.radius * 2; + }, + perimeter: () => 2 * Math.PI * this.radius, +}; -getAge(); +console.log(shape.diameter()); +console.log(shape.perimeter()); ``` -- A: `21` -- B: `undefined` -- C: `ReferenceError` -- D: `TypeError` +- A: `20` and `62.83185307179586` +- B: `20` and `NaN` +- C: `20` and `63` +- D: `NaN` and `63` -**Answer: C** +**Answer: B** -With `"use strict"`, you can make sure that you don't accidentally declare global variables. We never declared the variable `age`, and since we use `"use strict"`, it will throw a reference error. If we didn't use `"use strict"`, it would have worked, since the property `age` would have gotten added to the global object. +Note that the value of `diameter` is a regular function, whereas the value of `perimeter` is an arrow function. + +With arrow functions, the `this` keyword refers to its current surrounding scope, unlike regular functions! This means that when we call `perimeter`, it doesn't refer to the shape object, but to its surrounding scope (window for example). + +There is no value `radius` on that object, which returns `undefined`. -## Q. ***What is value of `sum`?*** +## Q. What is the output? ```javascript -const sum = eval("10*10+5"); ++true; +!"Lydia"; ``` -- A: `105` -- B: `"105"` -- C: `TypeError` -- D: `"10*10+5"` +- A: `1` and `false` +- B: `false` and `NaN` +- C: `false` and `false` **Answer: A** -`eval` evaluates codes that's passed as a string. If it's an expression, like in this case, it evaluates the expression. The expression is `10 * 10 + 5`. This returns the number `105`. +The unary plus tries to convert an operand to a number. `true` is `1`, and `false` is `0`. + +The string `'Lydia'` is a truthy value. What we're actually asking, is "is this truthy value falsy?". This returns `false`. -## Q. ***How long is cool_secret accessible?*** +## Q. Which one is true? + +```javascript +const bird = { + size: "small", +}; + +const mouse = { + name: "Mickey", + small: true, +}; +``` + +- A: `mouse.bird.size` is not valid +- B: `mouse[bird.size]` is not valid +- C: `mouse[bird["size"]]` is not valid +- D: All of them are valid -```javascript -sessionStorage.setItem("cool_secret", 123); -``` +**Answer: A** -- A: Forever, the data doesn't get lost. -- B: When the user closes the tab. -- C: When the user closes the entire browser, not only the tab. -- D: When the user shuts off their computer. +In JavaScript, all object keys are strings (unless it's a Symbol). Even though we might not _type_ them as strings, they are always converted into strings under the hood. -**Answer: B** +JavaScript interprets (or unboxes) statements. When we use bracket notation, it sees the first opening bracket `[` and keeps going until it finds the closing bracket `]`. Only then, it will evaluate the statement. -The data stored in `sessionStorage` is removed after closing the _tab_. +`mouse[bird.size]`: First it evaluates `bird.size`, which is `"small"`. `mouse["small"]` returns `true` -If you used `localStorage`, the data would've been there forever, unless for example `localStorage.clear()` is invoked. +However, with dot notation, this doesn't happen. `mouse` does not have a key called `bird`, which means that `mouse.bird` is `undefined`. Then, we ask for the `size` using dot notation: `mouse.bird.size`. Since `mouse.bird` is `undefined`, we're actually asking `undefined.size`. This isn't valid, and will throw an error similar to `Cannot read property "size" of undefined`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -var num = 8; -var num = 10; +let c = { greeting: "Hey!" }; +let d; -console.log(num); +d = c; +c.greeting = "Hello"; +console.log(d.greeting); ``` -- A: `8` -- B: `10` -- C: `SyntaxError` +- A: `Hello` +- B: `Hey!` +- C: `undefined` - D: `ReferenceError` +- E: `TypeError` -**Answer: B** +**Answer: A** -With the `var` keyword, you can declare multiple variables with the same name. The variable will then hold the latest value. -You cannot do this with `let` or `const` since they're block-scoped. +In JavaScript, all objects interact by _reference_ when setting them equal to each other. + +First, variable `c` holds a value to an object. Later, we assign `d` with the same reference that `c` has to the object. + + + +When you change one object, you change all of them. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const obj = { 1: "a", 2: "b", 3: "c" }; -const set = new Set([1, 2, 3, 4, 5]); +let a = 3; +let b = new Number(3); +let c = 3; -obj.hasOwnProperty("1"); -obj.hasOwnProperty(1); -set.has("1"); -set.has(1); +console.log(a == b); +console.log(a === b); +console.log(b === c); ``` -- A: `false` `true` `false` `true` -- B: `false` `true` `true` `true` -- C: `true` `true` `false` `true` -- D: `true` `true` `true` `true` +- A: `true` `false` `true` +- B: `false` `false` `true` +- C: `true` `false` `false` +- D: `false` `true` `true` **Answer: C** -All object keys (excluding Symbols) are strings under the hood, even if you don't type it yourself as a string. This is why `obj.hasOwnProperty('1')` also returns true. +`new Number()` is a built-in function constructor. Although it looks like a number, it's not really a number: it has a bunch of extra features and is an object. -It doesn't work that way for a set. There is no `'1'` in our set: `set.has('1')` returns `false`. It has the numeric type `1`, `set.has(1)` returns `true`. +When we use the `==` operator, it only checks whether it has the same _value_. They both have the value of `3`, so it returns `true`. + +However, when we use the `===` operator, both value _and_ type should be the same. It's not: `new Number()` is not a number, it's an **object**. Both return `false.` -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const obj = { a: "one", b: "two", a: "three" }; -console.log(obj); -``` - -- A: `{ a: "one", b: "two" }` -- B: `{ b: "two", a: "three" }` -- C: `{ a: "three", b: "two" }` -- D: `SyntaxError` - -**Answer: C** - -If you have two keys with the same name, the key will be replaced. It will still be in its first position, but with the last specified value. +class Chameleon { + static colorChange(newColor) { + this.newColor = newColor; + return this.newColor; + } - + constructor({ newColor = "green" } = {}) { + this.newColor = newColor; + } +} -## Q. ***The JavaScript global execution context creates two things for you: the global object, and the "this" keyword.*** +const freddie = new Chameleon({ newColor: "purple" }); +console.log(freddie.colorChange("orange")); +``` -- A: true -- B: false -- C: it depends +- A: `orange` +- B: `purple` +- C: `green` +- D: `TypeError` -**Answer: A** +**Answer: D** -The base execution context is the global execution context: it's What is accessible everywhere in your code. +The `colorChange` function is static. Static methods are designed to live only on the constructor in which they are created, and cannot be passed down to any children. Since `freddie` is a child, the function is not passed down, and not available on the `freddie` instance: a `TypeError` is thrown. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -for (let i = 1; i < 5; i++) { - if (i === 3) continue; - console.log(i); -} +let greeting; +greetign = {}; // Typo! +console.log(greetign); ``` -- A: `1` `2` -- B: `1` `2` `3` -- C: `1` `2` `4` -- D: `1` `3` `4` +- A: `{}` +- B: `ReferenceError: greetign is not defined` +- C: `undefined` -**Answer: C** +**Answer: A** -The `continue` statement skips an iteration if a certain condition returns `true`. +It logs the object, because we just created an empty object on the global object! When we mistyped `greeting` as `greetign`, the JS interpreter actually saw this as `global.greetign = {}` (or `window.greetign = {}` in a browser). + +In order to avoid this, we can use `"use strict"`. This makes sure that you have declared a variable before setting it equal to anything. -## Q. ***What is the output?*** +## Q. What happens when we do this? ```javascript -String.prototype.giveLydiaPizza = () => { - return "Just give Lydia pizza already!"; -}; - -const name = "Lydia"; +function bark() { + console.log("Woof!"); +} -name.giveLydiaPizza(); +bark.animal = "dog"; ``` -- A: `"Just give Lydia pizza already!"` -- B: `TypeError: not a function` -- C: `SyntaxError` -- D: `undefined` +- A: Nothing, this is totally fine! +- B: `SyntaxError`. You cannot add properties to a function this way. +- C: `"Woof"` gets logged. +- D: `ReferenceError` **Answer: A** -`String` is a built-in constructor, which we can add properties to. I just added a method to its prototype. Primitive strings are automatically converted into a string object, generated by the string prototype function. So, all strings (string objects) have access to that method! +This is possible in JavaScript, because functions are objects! (Everything besides primitive types are objects) + +A function is a special type of object. The code you write yourself isn't the actual function. The function is an object with properties. This property is invocable. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const a = {}; -const b = { key: "b" }; -const c = { key: "c" }; +function Person(firstName, lastName) { + this.firstName = firstName; + this.lastName = lastName; +} -a[b] = 123; -a[c] = 456; +const member = new Person("Lydia", "Hallie"); +Person.getFullName = function () { + return `${this.firstName} ${this.lastName}`; +}; -console.log(a[b]); +console.log(member.getFullName()); ``` -- A: `123` -- B: `456` -- C: `undefined` -- D: `ReferenceError` +- A: `TypeError` +- B: `SyntaxError` +- C: `Lydia Hallie` +- D: `undefined` `undefined` -**Answer: B** +**Answer: A** -Object keys are automatically converted into strings. We are trying to set an object as a key to object `a`, with the value of `123`. +You can't add properties to a constructor like you can with regular objects. If you want to add a feature to all objects at once, you have to use the prototype instead. So in this case, -However, when we stringify an object, it becomes `"[Object object]"`. So what we are saying here, is that `a["Object object"] = 123`. Then, we can try to do the same again. `c` is another object that we are implicitly stringifying. So then, `a["Object object"] = 456`. +```js +Person.prototype.getFullName = function () { + return `${this.firstName} ${this.lastName}`; +}; +``` -Then, we log `a[b]`, which is actually `a["Object object"]`. We just set that to `456`, so it returns `456`. +would have made `member.getFullName()` work. Why is this beneficial? Say that we added this method to the constructor itself. Maybe not every `Person` instance needed this method. This would waste a lot of memory space, since they would still have that property, which takes of memory space for each instance. Instead, if we only add it to the prototype, we just have it at one spot in memory, yet they all have access to it! -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const foo = () => console.log("First"); -const bar = () => setTimeout(() => console.log("Second")); -const baz = () => console.log("Third"); +function Person(firstName, lastName) { + this.firstName = firstName; + this.lastName = lastName; +} -bar(); -foo(); -baz(); +const lydia = new Person("Lydia", "Hallie"); +const sarah = Person("Sarah", "Smith"); + +console.log(lydia); +console.log(sarah); ``` -- A: `First` `Second` `Third` -- B: `First` `Third` `Second` -- C: `Second` `First` `Third` -- D: `Second` `Third` `First` +- A: `Person {firstName: "Lydia", lastName: "Hallie"}` and `undefined` +- B: `Person {firstName: "Lydia", lastName: "Hallie"}` and `Person {firstName: "Sarah", lastName: "Smith"}` +- C: `Person {firstName: "Lydia", lastName: "Hallie"}` and `{}` +- D:`Person {firstName: "Lydia", lastName: "Hallie"}` and `ReferenceError` -**Answer: B** +**Answer: A** -We have a `setTimeout` function and invoked it first. Yet, it was logged last. +For `sarah`, we didn't use the `new` keyword. When using `new`, it refers to the new empty object we create. However, if you don't add `new` it refers to the **global object**! -This is because in browsers, we don't just have the runtime engine, we also have something called a `WebAPI`. The `WebAPI` gives us the `setTimeout` function to start with, and for example the DOM. +We said that `this.firstName` equals `"Sarah"` and `this.lastName` equals `"Smith"`. What we actually did, is defining `global.firstName = 'Sarah'` and `global.lastName = 'Smith'`. `sarah` itself is left `undefined`, since we don't return a value from the `Person` function. -After the _callback_ is pushed to the WebAPI, the `setTimeout` function itself (but not the callback!) is popped off the stack. + - +## Q. What are the three phases of event propagation? -Now, `foo` gets invoked, and `"First"` is being logged. +- A: Target > Capturing > Bubbling +- B: Bubbling > Target > Capturing +- C: Target > Bubbling > Capturing +- D: Capturing > Target > Bubbling - +**Answer: D** -`foo` is popped off the stack, and `baz` gets invoked. `"Third"` gets logged. +During the **capturing** phase, the event goes through the ancestor elements down to the target element. It then reaches the **target** element, and **bubbling** begins. - + -The WebAPI can't just add stuff to the stack whenever it's ready. Instead, it pushes the callback function to something called the _queue_. + - +## Q. All object have prototypes. -This is where an event loop starts to work. An **event loop** looks at the stack and task queue. If the stack is empty, it takes the first thing on the queue and pushes it onto the stack. +- A: true +- B: false - +**Answer: B** -`bar` gets invoked, `"Second"` gets logged, and it's popped off the stack. +All objects have prototypes, except for the **base object**. The base object is the object created by the user, or an object that is created using the `new` keyword. The base object has access to some methods and properties, such as `.toString`. This is the reason why you can use built-in JavaScript methods! All of such methods are available on the prototype. Although JavaScript can't find it directly on your object, it goes down the prototype chain and finds it there, which makes it accessible for you. -## Q. ***What is the event.target when clicking the button?*** +## Q. What is the output? -```html -
-
- -
-
+```javascript +function sum(a, b) { + return a + b; +} + +sum(1, "2"); ``` -- A: Outer `div` -- B: Inner `div` -- C: `button` -- D: An array of all nested elements. +- A: `NaN` +- B: `TypeError` +- C: `"12"` +- D: `3` **Answer: C** -The deepest nested element that caused the event is the target of the event. You can stop bubbling by `event.stopPropagation` +JavaScript is a **dynamically typed language**: we don't specify what types certain variables are. Values can automatically be converted into another type without you knowing, which is called _implicit type coercion_. **Coercion** is converting from one type into another. + +In this example, JavaScript converts the number `1` into a string, in order for the function to make sense and return a value. During the addition of a numeric type (`1`) and a string type (`'2'`), the number is treated as a string. We can concatenate strings like `"Hello" + "World"`, so What is happening here is `"1" + "2"` which returns `"12"`. -## Q. ***When you click the paragraph, What is the logged output?*** +## Q. What is the output? -```html -
-

Click here!

-
+```javascript +let number = 0; +console.log(number++); +console.log(++number); +console.log(number); ``` -- A: `p` `div` -- B: `div` `p` -- C: `p` -- D: `div` +- A: `1` `1` `2` +- B: `1` `2` `2` +- C: `0` `2` `2` +- D: `0` `1` `2` -**Answer: A** +**Answer: C** -If we click `p`, we see two logs: `p` and `div`. During event propagation, there are 3 phases: capturing, target, and bubbling. By default, event handlers are executed in the bubbling phase (unless you set `useCapture` to `true`). It goes from the deepest nested element outwards. +The **postfix** unary operator `++`: + +1. Returns the value (this returns `0`) +2. Increments the value (number is now `1`) + +The **prefix** unary operator `++`: + +1. Increments the value (number is now `2`) +2. Returns the value (this returns `2`) + +This returns `0 2 2`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const person = { name: "Lydia" }; - -function sayHi(age) { - console.log(`${this.name} is ${age}`); +function getPersonInfo(one, two, three) { + console.log(one); + console.log(two); + console.log(three); } -sayHi.call(person, 21); -sayHi.bind(person, 21); -``` +const person = "Lydia"; +const age = 21; -- A: `undefined is 21` `Lydia is 21` -- B: `function` `function` -- C: `Lydia is 21` `Lydia is 21` -- D: `Lydia is 21` `function` +getPersonInfo`${person} is ${age} years old`; +``` -**Answer: D** +- A: `"Lydia"` `21` `["", " is ", " years old"]` +- B: `["", " is ", " years old"]` `"Lydia"` `21` +- C: `"Lydia"` `["", " is ", " years old"]` `21` -With both, we can pass the object to which we want the `this` keyword to refer to. However, `.call` is also _executed immediately_! +**Answer: B** -`.bind.` returns a _copy_ of the function, but with a bound context! It is not executed immediately. +If you use tagged template literals, the value of the first argument is always an array of the string values. The remaining arguments get the values of the passed expressions! -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -function sayHi() { - return (() => 0)(); +function checkAge(data) { + if (data === { age: 18 }) { + console.log("You are an adult!"); + } else if (data == { age: 18 }) { + console.log("You are still an adult."); + } else { + console.log(`Hmm.. You don't have an age I guess`); + } } -console.log(typeof sayHi()); +checkAge({ age: 18 }); ``` -- A: `"object"` -- B: `"number"` -- C: `"function"` -- D: `"undefined"` +- A: `You are an adult!` +- B: `You are still an adult.` +- C: `Hmm.. You don't have an age I guess` -**Answer: B** +**Answer: C** -The `sayHi` function returns the returned value of the immediately invoked function (IIFE). This function returned `0`, which is type `"number"`. +When testing equality, primitives are compared by their _value_, while objects are compared by their _reference_. JavaScript checks if the objects have a reference to the same location in memory. -FYI: there are only 7 built-in types: `null`, `undefined`, `boolean`, `number`, `string`, `object`, and `symbol`. `"function"` is not a type, since functions are objects, it's of type `"object"`. +The two objects that we are comparing don't have that: the object we passed as a parameter refers to a different location in memory than the object we used in order to check equality. + +This is why both `{ age: 18 } === { age: 18 }` and `{ age: 18 } == { age: 18 }` return `false`. -## Q. ***Which of these values are falsy?*** +## Q. What is the output? ```javascript -0; -new Number(0); -(""); -(" "); -new Boolean(false); -undefined; -``` - -- A: `0`, `''`, `undefined` -- B: `0`, `new Number(0)`, `''`, `new Boolean(false)`, `undefined` -- C: `0`, `''`, `new Boolean(false)`, `undefined` -- D: All of them are falsy +function getAge(...args) { + console.log(typeof args); +} -**Answer: A** +getAge(21); +``` -There are only six falsy values: +- A: `"number"` +- B: `"array"` +- C: `"object"` +- D: `"NaN"` -- `undefined` -- `null` -- `NaN` -- `0` -- `''` (empty string) -- `false` +**Answer: C** -Function constructors, like `new Number` and `new Boolean` are truthy. +The rest parameter (`...args`.) lets us "collect" all remaining arguments into an array. An array is an object, so `typeof args` returns `"object"` -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -console.log(typeof typeof 1); +function getAge() { + "use strict"; + age = 21; + console.log(age); +} + +getAge(); ``` -- A: `"number"` -- B: `"string"` -- C: `"object"` -- D: `"undefined"` +- A: `21` +- B: `undefined` +- C: `ReferenceError` +- D: `TypeError` -**Answer: B** +**Answer: C** -`typeof 1` returns `"number"`. -`typeof "number"` returns `"string"` +With `"use strict"`, you can make sure that you don't accidentally declare global variables. We never declared the variable `age`, and since we use `"use strict"`, it will throw a reference error. If we didn't use `"use strict"`, it would have worked, since the property `age` would have gotten added to the global object. -## Q. ***What is the output?*** +## Q. What is value of `sum`? ```javascript -const numbers = [1, 2, 3]; -numbers[10] = 11; -console.log(numbers); +const sum = eval("10*10+5"); ``` -- A: `[1, 2, 3, 7 x null, 11]` -- B: `[1, 2, 3, 11]` -- C: `[1, 2, 3, 7 x empty, 11]` -- D: `SyntaxError` - -**Answer: C** - -When you set a value to an element in an array that exceeds the length of the array, JavaScript creates something called "empty slots". These actually have the value of `undefined`, but you will see something like: +- A: `105` +- B: `"105"` +- C: `TypeError` +- D: `"10*10+5"` -`[1, 2, 3, 7 x empty, 11]` +**Answer: A** -depending on where you run it (it's different for every browser, node, etc.) +`eval` evaluates codes that's passed as a string. If it's an expression, like in this case, it evaluates the expression. The expression is `10 * 10 + 5`. This returns the number `105`. -## Q. ***What is the output?*** +## Q. How long is cool_secret accessible? ```javascript -(() => { - let x, y; - try { - throw new Error(); - } catch (x) { - (x = 1), (y = 2); - console.log(x); - } - console.log(x); - console.log(y); -})(); +sessionStorage.setItem("cool_secret", 123); ``` -- A: `1` `undefined` `2` -- B: `undefined` `undefined` `undefined` -- C: `1` `1` `2` -- D: `1` `undefined` `undefined` - -**Answer: A** +- A: Forever, the data doesn't get lost. +- B: When the user closes the tab. +- C: When the user closes the entire browser, not only the tab. +- D: When the user shuts off their computer. -The `catch` block receives the argument `x`. This is not the same `x` as the variable when we pass arguments. This variable `x` is block-scoped. +**Answer: B** -Later, we set this block-scoped variable equal to `1`, and set the value of the variable `y`. Now, we log the block-scoped variable `x`, which is equal to `1`. +The data stored in `sessionStorage` is removed after closing the _tab_. -Outside of the `catch` block, `x` is still `undefined`, and `y` is `2`. When we want to `console.log(x)` outside of the `catch` block, it returns `undefined`, and `y` returns `2`. +If you used `localStorage`, the data would've been there forever, unless for example `localStorage.clear()` is invoked. -## Q. ***Everything in JavaScript is either a...*** +## Q. What is the output? -- A: primitive or object -- B: function or object -- C: trick question! only objects -- D: number or object +```javascript +var num = 8; +var num = 10; -**Answer: A** +console.log(num); +``` -JavaScript only has primitive types and objects. +- A: `8` +- B: `10` +- C: `SyntaxError` +- D: `ReferenceError` -Primitive types are `boolean`, `null`, `undefined`, `bigint`, `number`, `string`, and `symbol`. +**Answer: B** -What differentiates a primitive from an object is that primitives do not have any properties or methods; however, you'll note that `'foo'.toUpperCase()` evaluates to `'FOO'` and does not result in a `TypeError`. This is because when you try to access a property or method on a primitive like a string, JavaScript will implicitly wrap the object using one of the wrapper classes, i.e. `String`, and then immediately discard the wrapper after the expression evaluates. All primitives except for `null` and `undefined` exhibit this behaviour. +With the `var` keyword, you can declare multiple variables with the same name. The variable will then hold the latest value. +You cannot do this with `let` or `const` since they're block-scoped. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -[ - [0, 1], - [2, 3], -].reduce( - (acc, cur) => { - return acc.concat(cur); - }, - [1, 2] -); +const obj = { 1: "a", 2: "b", 3: "c" }; +const set = new Set([1, 2, 3, 4, 5]); + +obj.hasOwnProperty("1"); +obj.hasOwnProperty(1); +set.has("1"); +set.has(1); ``` -- A: `[0, 1, 2, 3, 1, 2]` -- B: `[6, 1, 2]` -- C: `[1, 2, 0, 1, 2, 3]` -- D: `[1, 2, 6]` +- A: `false` `true` `false` `true` +- B: `false` `true` `true` `true` +- C: `true` `true` `false` `true` +- D: `true` `true` `true` `true` **Answer: C** -`[1, 2]` is our initial value. This is the value we start with, and the value of the very first `acc`. During the first round, `acc` is `[1,2]`, and `cur` is `[0, 1]`. We concatenate them, which results in `[1, 2, 0, 1]`. +All object keys (excluding Symbols) are strings under the hood, even if you don't type it yourself as a string. This is why `obj.hasOwnProperty('1')` also returns true. -Then, `[1, 2, 0, 1]` is `acc` and `[2, 3]` is `cur`. We concatenate them, and get `[1, 2, 0, 1, 2, 3]` +It doesn't work that way for a set. There is no `'1'` in our set: `set.has('1')` returns `false`. It has the numeric type `1`, `set.has(1)` returns `true`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -!!null; -!!""; -!!1; +const obj = { a: "one", b: "two", a: "three" }; +console.log(obj); ``` -- A: `false` `true` `false` -- B: `false` `false` `true` -- C: `false` `true` `true` -- D: `true` `true` `false` +- A: `{ a: "one", b: "two" }` +- B: `{ b: "two", a: "three" }` +- C: `{ a: "three", b: "two" }` +- D: `SyntaxError` + +**Answer: C** + +If you have two keys with the same name, the key will be replaced. It will still be in its first position, but with the last specified value. + + -**Answer: B** +## Q. The JavaScript global execution context creates two things for you: the global object, and the "this" keyword. -`null` is falsy. `!null` returns `true`. `!true` returns `false`. +- A: true +- B: false +- C: it depends -`""` is falsy. `!""` returns `true`. `!true` returns `false`. +**Answer: A** -`1` is truthy. `!1` returns `false`. `!false` returns `true`. +The base execution context is the global execution context: it's What is accessible everywhere in your code. -## Q. ***What does the `setInterval` method return in the browser?*** +## Q. What is the output? ```javascript -setInterval(() => console.log("Hi"), 1000); +for (let i = 1; i < 5; i++) { + if (i === 3) continue; + console.log(i); +} ``` -- A: a unique id -- B: the amount of milliseconds specified -- C: the passed function -- D: `undefined` +- A: `1` `2` +- B: `1` `2` `3` +- C: `1` `2` `4` +- D: `1` `3` `4` -**Answer: A** +**Answer: C** -It returns a unique id. This id can be used to clear that interval with the `clearInterval()` function. +The `continue` statement skips an iteration if a certain condition returns `true`. -## Q. ***What does this return?*** +## Q. What is the output? ```javascript -[..."Lydia"]; +String.prototype.giveLydiaPizza = () => { + return "Just give Lydia pizza already!"; +}; + +const name = "Lydia"; + +name.giveLydiaPizza(); ``` -- A: `["L", "y", "d", "i", "a"]` -- B: `["Lydia"]` -- C: `[[], "Lydia"]` -- D: `[["L", "y", "d", "i", "a"]]` +- A: `"Just give Lydia pizza already!"` +- B: `TypeError: not a function` +- C: `SyntaxError` +- D: `undefined` **Answer: A** -A string is an iterable. The spread operator maps every character of an iterable to one element. +`String` is a built-in constructor, which we can add properties to. I just added a method to its prototype. Primitive strings are automatically converted into a string object, generated by the string prototype function. So, all strings (string objects) have access to that method! -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -function* generator(i) { - yield i; - yield i * 2; -} +const a = {}; +const b = { key: "b" }; +const c = { key: "c" }; -const gen = generator(10); +a[b] = 123; +a[c] = 456; -console.log(gen.next().value); -console.log(gen.next().value); +console.log(a[b]); ``` -- A: `[0, 10], [10, 20]` -- B: `20, 20` -- C: `10, 20` -- D: `0, 10 and 10, 20` +- A: `123` +- B: `456` +- C: `undefined` +- D: `ReferenceError` -**Answer: C** +**Answer: B** -Regular functions cannot be stopped mid-way after invocation. However, a generator function can be "stopped" midway, and later continue from where it stopped. Every time a generator function encounters a `yield` keyword, the function yields the value specified after it. Note that the generator function in that case doesn’t _return_ the value, it _yields_ the value. +Object keys are automatically converted into strings. We are trying to set an object as a key to object `a`, with the value of `123`. -First, we initialize the generator function with `i` equal to `10`. We invoke the generator function using the `next()` method. The first time we invoke the generator function, `i` is equal to `10`. It encounters the first `yield` keyword: it yields the value of `i`. The generator is now "paused", and `10` gets logged. +However, when we stringify an object, it becomes `"[Object object]"`. So what we are saying here, is that `a["Object object"] = 123`. Then, we can try to do the same again. `c` is another object that we are implicitly stringifying. So then, `a["Object object"] = 456`. -Then, we invoke the function again with the `next()` method. It starts to continue where it stopped previously, still with `i` equal to `10`. Now, it encounters the next `yield` keyword, and yields `i * 2`. `i` is equal to `10`, so it returns `10 * 2`, which is `20`. This results in `10, 20`. +Then, we log `a[b]`, which is actually `a["Object object"]`. We just set that to `456`, so it returns `456`. -## Q. ***What does this return?*** +## Q. What is the output? ```javascript -const firstPromise = new Promise((res, rej) => { - setTimeout(res, 500, "one"); -}); - -const secondPromise = new Promise((res, rej) => { - setTimeout(res, 100, "two"); -}); +const foo = () => console.log("First"); +const bar = () => setTimeout(() => console.log("Second")); +const baz = () => console.log("Third"); -Promise.race([firstPromise, secondPromise]).then((res) => console.log(res)); +bar(); +foo(); +baz(); ``` -- A: `"one"` -- B: `"two"` -- C: `"two" "one"` -- D: `"one" "two"` +- A: `First` `Second` `Third` +- B: `First` `Third` `Second` +- C: `Second` `First` `Third` +- D: `Second` `Third` `First` **Answer: B** -When we pass multiple promises to the `Promise.race` method, it resolves/rejects the _first_ promise that resolves/rejects. To the `setTimeout` method, we pass a timer: 500ms for the first promise (`firstPromise`), and 100ms for the second promise (`secondPromise`). This means that the `secondPromise` resolves first with the value of `'two'`. `res` now holds the value of `'two'`, which gets logged. - - +We have a `setTimeout` function and invoked it first. Yet, it was logged last. -## Q. ***What is the output?*** +This is because in browsers, we don't just have the runtime engine, we also have something called a `WebAPI`. The `WebAPI` gives us the `setTimeout` function to start with, and for example the DOM. -```javascript -let person = { name: "Lydia" }; -const members = [person]; -person = null; +After the _callback_ is pushed to the WebAPI, the `setTimeout` function itself (but not the callback!) is popped off the stack. -console.log(members); -``` + -- A: `null` -- B: `[null]` -- C: `[{}]` -- D: `[{ name: "Lydia" }]` +Now, `foo` gets invoked, and `"First"` is being logged. -**Answer: D** + -First, we declare a variable `person` with the value of an object that has a `name` property. +`foo` is popped off the stack, and `baz` gets invoked. `"Third"` gets logged. - + -Then, we declare a variable called `members`. We set the first element of that array equal to the value of the `person` variable. Objects interact by _reference_ when setting them equal to each other. When you assign a reference from one variable to another, you make a _copy_ of that reference. (note that they don't have the _same_ reference!) +The WebAPI can't just add stuff to the stack whenever it's ready. Instead, it pushes the callback function to something called the _queue_. - + -Then, we set the variable `person` equal to `null`. +This is where an event loop starts to work. An **event loop** looks at the stack and task queue. If the stack is empty, it takes the first thing on the queue and pushes it onto the stack. - + -We are only modifying the value of the `person` variable, and not the first element in the array, since that element has a different (copied) reference to the object. The first element in `members` still holds its reference to the original object. When we log the `members` array, the first element still holds the value of the object, which gets logged. +`bar` gets invoked, `"Second"` gets logged, and it's popped off the stack. -## Q. ***What is the output?*** - -```javascript -const person = { - name: "Lydia", - age: 21, -}; +## Q. What is the event.target when clicking the button? -for (const item in person) { - console.log(item); -} +```html +
+
+ +
+
``` -- A: `{ name: "Lydia" }, { age: 21 }` -- B: `"name", "age"` -- C: `"Lydia", 21` -- D: `["name", "Lydia"], ["age", 21]` +- A: Outer `div` +- B: Inner `div` +- C: `button` +- D: An array of all nested elements. -**Answer: B** +**Answer: C** -With a `for-in` loop, we can iterate through object keys, in this case `name` and `age`. Under the hood, object keys are strings (if they're not a Symbol). On every loop, we set the value of `item` equal to the current key it’s iterating over. First, `item` is equal to `name`, and gets logged. Then, `item` is equal to `age`, which gets logged. +The deepest nested element that caused the event is the target of the event. You can stop bubbling by `event.stopPropagation` -## Q. ***What is the output?*** +## Q. When you click the paragraph, What is the logged output? -```javascript -console.log(3 + 4 + "5"); +```html +
+

Click here!

+
``` -- A: `"345"` -- B: `"75"` -- C: `12` -- D: `"12"` - -**Answer: B** - -Operator associativity is the order in which the compiler evaluates the expressions, either left-to-right or right-to-left. This only happens if all operators have the _same_ precedence. We only have one type of operator: `+`. For addition, the associativity is left-to-right. +- A: `p` `div` +- B: `div` `p` +- C: `p` +- D: `div` -`3 + 4` gets evaluated first. This results in the number `7`. +**Answer: A** -`7 + '5'` results in `"75"` because of coercion. JavaScript converts the number `7` into a string, see question 15. We can concatenate two strings using the `+`operator. `"7" + "5"` results in `"75"`. +If we click `p`, we see two logs: `p` and `div`. During event propagation, there are 3 phases: capturing, target, and bubbling. By default, event handlers are executed in the bubbling phase (unless you set `useCapture` to `true`). It goes from the deepest nested element outwards. -## Q. ***What is the value of `num`?*** +## Q. What is the output? ```javascript -const num = parseInt("7*6", 10); +const person = { name: "Lydia" }; + +function sayHi(age) { + console.log(`${this.name} is ${age}`); +} + +sayHi.call(person, 21); +sayHi.bind(person, 21); ``` -- A: `42` -- B: `"42"` -- C: `7` -- D: `NaN` +- A: `undefined is 21` `Lydia is 21` +- B: `function` `function` +- C: `Lydia is 21` `Lydia is 21` +- D: `Lydia is 21` `function` -**Answer: C** +**Answer: D** -Only the first numbers in the string is returned. Based on the _radix_ (the second argument in order to specify what type of number we want to parse it to: base 10, hexadecimal, octal, binary, etc.), the `parseInt` checks whether the characters in the string are valid. Once it encounters a character that isn't a valid number in the radix, it stops parsing and ignores the following characters. +With both, we can pass the object to which we want the `this` keyword to refer to. However, `.call` is also _executed immediately_! -`*` is not a valid number. It only parses `"7"` into the decimal `7`. `num` now holds the value of `7`. +`.bind.` returns a _copy_ of the function, but with a bound context! It is not executed immediately. -## Q. ***What is the output`?*** +## Q. What is the output? ```javascript -[1, 2, 3].map((num) => { - if (typeof num === "number") return; - return num * 2; -}); +function sayHi() { + return (() => 0)(); +} + +console.log(typeof sayHi()); ``` -- A: `[]` -- B: `[null, null, null]` -- C: `[undefined, undefined, undefined]` -- D: `[ 3 x empty ]` +- A: `"object"` +- B: `"number"` +- C: `"function"` +- D: `"undefined"` -**Answer: C** +**Answer: B** -When mapping over the array, the value of `num` is equal to the element it’s currently looping over. In this case, the elements are numbers, so the condition of the if statement `typeof num === "number"` returns `true`. The map function creates a new array and inserts the values returned from the function. +The `sayHi` function returns the returned value of the immediately invoked function (IIFE). This function returned `0`, which is type `"number"`. -However, we don’t return a value. When we don’t return a value from the function, the function returns `undefined`. For every element in the array, the function block gets called, so for each element we return `undefined`. +FYI: there are only 7 built-in types: `null`, `undefined`, `boolean`, `number`, `string`, `object`, and `symbol`. `"function"` is not a type, since functions are objects, it's of type `"object"`. -## Q. ***What is the output?*** +## Q. Which of these values are falsy? ```javascript -function getInfo(member, year) { - member.name = "Lydia"; - year = "1998"; -} - -const person = { name: "Sarah" }; -const birthYear = "1997"; - -getInfo(person, birthYear); - -console.log(person, birthYear); -``` - -- A: `{ name: "Lydia" }, "1997"` -- B: `{ name: "Sarah" }, "1998"` -- C: `{ name: "Lydia" }, "1998"` -- D: `{ name: "Sarah" }, "1997"` +0; +new Number(0); +(""); +(" "); +new Boolean(false); +undefined; +``` + +- A: `0`, `''`, `undefined` +- B: `0`, `new Number(0)`, `''`, `new Boolean(false)`, `undefined` +- C: `0`, `''`, `new Boolean(false)`, `undefined` +- D: All of them are falsy **Answer: A** -Arguments are passed by _value_, unless their value is an object, then they're passed by _reference_. `birthYear` is passed by value, since it's a string, not an object. When we pass arguments by value, a _copy_ of that value is created (see question 46). +There are only six falsy values: -The variable `birthYear` has a reference to the value `"1997"`. The argument `year` also has a reference to the value `"1997"`, but it's not the same value as `birthYear` has a reference to. When we update the value of `year` by setting `year` equal to `"1998"`, we are only updating the value of `year`. `birthYear` is still equal to `"1997"`. +- `undefined` +- `null` +- `NaN` +- `0` +- `''` (empty string) +- `false` -The value of `person` is an object. The argument `member` has a (copied) reference to the _same_ object. When we modify a property of the object `member` has a reference to, the value of `person` will also be modified, since they both have a reference to the same object. `person`'s `name` property is now equal to the value `"Lydia"` +Function constructors, like `new Number` and `new Boolean` are truthy. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -function greeting() { - throw "Hello world!"; -} - -function sayHi() { - try { - const data = greeting(); - console.log("It worked!", data); - } catch (e) { - console.log("Oh no an error:", e); - } -} - -sayHi(); +console.log(typeof typeof 1); ``` -- A: `It worked! Hello world!` -- B: `Oh no an error: undefined` -- C: `SyntaxError: can only throw Error objects` -- D: `Oh no an error: Hello world!` - -**Answer: D** +- A: `"number"` +- B: `"string"` +- C: `"object"` +- D: `"undefined"` -With the `throw` statement, we can create custom errors. With this statement, you can throw exceptions. An exception can be a string, a number, a boolean or an object. In this case, our exception is the string `'Hello world'`. +**Answer: B** -With the `catch` statement, we can specify what to do if an exception is thrown in the `try` block. An exception is thrown: the string `'Hello world'`. `e` is now equal to that string, which we log. This results in `'Oh an error: Hello world'`. +`typeof 1` returns `"number"`. +`typeof "number"` returns `"string"` -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -function Car() { - this.make = "Lamborghini"; - return { make: "Maserati" }; -} - -const myCar = new Car(); -console.log(myCar.make); +const numbers = [1, 2, 3]; +numbers[10] = 11; +console.log(numbers); ``` -- A: `"Lamborghini"` -- B: `"Maserati"` -- C: `ReferenceError` -- D: `TypeError` +- A: `[1, 2, 3, 7 x null, 11]` +- B: `[1, 2, 3, 11]` +- C: `[1, 2, 3, 7 x empty, 11]` +- D: `SyntaxError` -**Answer: B** +**Answer: C** -When you return a property, the value of the property is equal to the _returned_ value, not the value set in the constructor function. We return the string `"Maserati"`, so `myCar.make` is equal to `"Maserati"`. +When you set a value to an element in an array that exceeds the length of the array, JavaScript creates something called "empty slots". These actually have the value of `undefined`, but you will see something like: + +`[1, 2, 3, 7 x empty, 11]` + +depending on where you run it (it's different for every browser, node, etc.) -## Q. ***What is the output?*** +## Q. What is the output? ```javascript (() => { - let x = (y = 10); + let x, y; + try { + throw new Error(); + } catch (x) { + (x = 1), (y = 2); + console.log(x); + } + console.log(x); + console.log(y); })(); - -console.log(typeof x); -console.log(typeof y); ``` -- A: `"undefined", "number"` -- B: `"number", "number"` -- C: `"object", "number"` -- D: `"number", "undefined"` +- A: `1` `undefined` `2` +- B: `undefined` `undefined` `undefined` +- C: `1` `1` `2` +- D: `1` `undefined` `undefined` **Answer: A** -`let x = y = 10;` is actually shorthand for: - -```javascript -y = 10; -let x = y; -``` - -When we set `y` equal to `10`, we actually add a property `y` to the global object (`window` in browser, `global` in Node). In a browser, `window.y` is now equal to `10`. +The `catch` block receives the argument `x`. This is not the same `x` as the variable when we pass arguments. This variable `x` is block-scoped. -Then, we declare a variable `x` with the value of `y`, which is `10`. Variables declared with the `let` keyword are _block scoped_, they are only defined within the block they're declared in; the immediately-invoked function (IIFE) in this case. When we use the `typeof` operator, the operand `x` is not defined: we are trying to access `x` outside of the block it's declared in. This means that `x` is not defined. Values who haven't been assigned a value or declared are of type `"undefined"`. `console.log(typeof x)` returns `"undefined"`. +Later, we set this block-scoped variable equal to `1`, and set the value of the variable `y`. Now, we log the block-scoped variable `x`, which is equal to `1`. -However, we created a global variable `y` when setting `y` equal to `10`. This value is accessible anywhere in our code. `y` is defined, and holds a value of type `"number"`. `console.log(typeof y)` returns `"number"`. +Outside of the `catch` block, `x` is still `undefined`, and `y` is `2`. When we want to `console.log(x)` outside of the `catch` block, it returns `undefined`, and `y` returns `2`. -## Q. ***What is the output?*** +## Q. Everything in JavaScript is either a... -```javascript -class Dog { - constructor(name) { - this.name = name; - } -} +- A: primitive or object +- B: function or object +- C: trick question! only objects +- D: number or object -Dog.prototype.bark = function () { - console.log(`Woof I am ${this.name}`); -}; +**Answer: A** -const pet = new Dog("Mara"); +JavaScript only has primitive types and objects. -pet.bark(); +Primitive types are `boolean`, `null`, `undefined`, `bigint`, `number`, `string`, and `symbol`. -delete Dog.prototype.bark; +What differentiates a primitive from an object is that primitives do not have any properties or methods; however, you'll note that `'foo'.toUpperCase()` evaluates to `'FOO'` and does not result in a `TypeError`. This is because when you try to access a property or method on a primitive like a string, JavaScript will implicitly wrap the object using one of the wrapper classes, i.e. `String`, and then immediately discard the wrapper after the expression evaluates. All primitives except for `null` and `undefined` exhibit this behaviour. -pet.bark(); + + +## Q. What is the output? + +```javascript +[ + [0, 1], + [2, 3], +].reduce( + (acc, cur) => { + return acc.concat(cur); + }, + [1, 2] +); ``` -- A: `"Woof I am Mara"`, `TypeError` -- B: `"Woof I am Mara"`, `"Woof I am Mara"` -- C: `"Woof I am Mara"`, `undefined` -- D: `TypeError`, `TypeError` +- A: `[0, 1, 2, 3, 1, 2]` +- B: `[6, 1, 2]` +- C: `[1, 2, 0, 1, 2, 3]` +- D: `[1, 2, 6]` -**Answer: A** +**Answer: C** -We can delete properties from objects using the `delete` keyword, also on the prototype. By deleting a property on the prototype, it is not available anymore in the prototype chain. In this case, the `bark` function is not available anymore on the prototype after `delete Dog.prototype.bark`, yet we still try to access it. +`[1, 2]` is our initial value. This is the value we start with, and the value of the very first `acc`. During the first round, `acc` is `[1,2]`, and `cur` is `[0, 1]`. We concatenate them, which results in `[1, 2, 0, 1]`. -When we try to invoke something that is not a function, a `TypeError` is thrown. In this case `TypeError: pet.bark is not a function`, since `pet.bark` is `undefined`. +Then, `[1, 2, 0, 1]` is `acc` and `[2, 3]` is `cur`. We concatenate them, and get `[1, 2, 0, 1, 2, 3]` -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const set = new Set([1, 1, 2, 3, 4]); - -console.log(set); +!!null; +!!""; +!!1; ``` -- A: `[1, 1, 2, 3, 4]` -- B: `[1, 2, 3, 4]` -- C: `{1, 1, 2, 3, 4}` -- D: `{1, 2, 3, 4}` +- A: `false` `true` `false` +- B: `false` `false` `true` +- C: `false` `true` `true` +- D: `true` `true` `false` -**Answer: D** +**Answer: B** -The `Set` object is a collection of _unique_ values: a value can only occur once in a set. +`null` is falsy. `!null` returns `true`. `!true` returns `false`. -We passed the iterable `[1, 1, 2, 3, 4]` with a duplicate value `1`. Since we cannot have two of the same values in a set, one of them is removed. This results in `{1, 2, 3, 4}`. +`""` is falsy. `!""` returns `true`. `!true` returns `false`. + +`1` is truthy. `!1` returns `false`. `!false` returns `true`. -## Q. ***What is the output?*** - -```javascript -// counter.js -let counter = 10; -export default counter; -``` +## Q. What does the `setInterval` method return in the browser? ```javascript -// index.js -import myCounter from "./counter"; - -myCounter += 1; - -console.log(myCounter); +setInterval(() => console.log("Hi"), 1000); ``` -- A: `10` -- B: `11` -- C: `Error` -- D: `NaN` - -**Answer: C** +- A: a unique id +- B: the amount of milliseconds specified +- C: the passed function +- D: `undefined` -An imported module is _read-only_: you cannot modify the imported module. Only the module that exports them can change its value. +**Answer: A** -When we try to increment the value of `myCounter`, it throws an error: `myCounter` is read-only and cannot be modified. +It returns a unique id. This id can be used to clear that interval with the `clearInterval()` function. -## Q. ***What is the output?*** +## Q. What does this return? ```javascript -const name = "Lydia"; -age = 21; - -console.log(delete name); -console.log(delete age); +[..."Lydia"]; ``` -- A: `false`, `true` -- B: `"Lydia"`, `21` -- C: `true`, `true` -- D: `undefined`, `undefined` +- A: `["L", "y", "d", "i", "a"]` +- B: `["Lydia"]` +- C: `[[], "Lydia"]` +- D: `[["L", "y", "d", "i", "a"]]` **Answer: A** -The `delete` operator returns a boolean value: `true` on a successful deletion, else it'll return `false`. However, variables declared with the `var`, `const` or `let` keyword cannot be deleted using the `delete` operator. - -The `name` variable was declared with a `const` keyword, so its deletion is not successful: `false` is returned. When we set `age` equal to `21`, we actually added a property called `age` to the global object. You can successfully delete properties from objects this way, also the global object, so `delete age` returns `true`. +A string is an iterable. The spread operator maps every character of an iterable to one element. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const numbers = [1, 2, 3, 4, 5]; -const [y] = numbers; +function* generator(i) { + yield i; + yield i * 2; +} -console.log(y); +const gen = generator(10); + +console.log(gen.next().value); +console.log(gen.next().value); ``` -- A: `[[1, 2, 3, 4, 5]]` -- B: `[1, 2, 3, 4, 5]` -- C: `1` -- D: `[1]` +- A: `[0, 10], [10, 20]` +- B: `20, 20` +- C: `10, 20` +- D: `0, 10 and 10, 20` **Answer: C** -We can unpack values from arrays or properties from objects through destructuring. For example: +Regular functions cannot be stopped mid-way after invocation. However, a generator function can be "stopped" midway, and later continue from where it stopped. Every time a generator function encounters a `yield` keyword, the function yields the value specified after it. Note that the generator function in that case doesn’t _return_ the value, it _yields_ the value. -```javascript -[a, b] = [1, 2]; -``` +First, we initialize the generator function with `i` equal to `10`. We invoke the generator function using the `next()` method. The first time we invoke the generator function, `i` is equal to `10`. It encounters the first `yield` keyword: it yields the value of `i`. The generator is now "paused", and `10` gets logged. - +Then, we invoke the function again with the `next()` method. It starts to continue where it stopped previously, still with `i` equal to `10`. Now, it encounters the next `yield` keyword, and yields `i * 2`. `i` is equal to `10`, so it returns `10 * 2`, which is `20`. This results in `10, 20`. -The value of `a` is now `1`, and the value of `b` is now `2`. What we actually did in the question, is: + + +## Q. What does this return? ```javascript -[y] = [1, 2, 3, 4, 5]; +const firstPromise = new Promise((res, rej) => { + setTimeout(res, 500, "one"); +}); + +const secondPromise = new Promise((res, rej) => { + setTimeout(res, 100, "two"); +}); + +Promise.race([firstPromise, secondPromise]).then((res) => console.log(res)); ``` - +- A: `"one"` +- B: `"two"` +- C: `"two" "one"` +- D: `"one" "two"` -This means that the value of `y` is equal to the first value in the array, which is the number `1`. When we log `y`, `1` is returned. +**Answer: B** + +When we pass multiple promises to the `Promise.race` method, it resolves/rejects the _first_ promise that resolves/rejects. To the `setTimeout` method, we pass a timer: 500ms for the first promise (`firstPromise`), and 100ms for the second promise (`secondPromise`). This means that the `secondPromise` resolves first with the value of `'two'`. `res` now holds the value of `'two'`, which gets logged. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const user = { name: "Lydia", age: 21 }; -const admin = { admin: true, ...user }; +let person = { name: "Lydia" }; +const members = [person]; +person = null; -console.log(admin); +console.log(members); ``` -- A: `{ admin: true, user: { name: "Lydia", age: 21 } }` -- B: `{ admin: true, name: "Lydia", age: 21 }` -- C: `{ admin: true, user: ["Lydia", 21] }` -- D: `{ admin: true }` +- A: `null` +- B: `[null]` +- C: `[{}]` +- D: `[{ name: "Lydia" }]` -**Answer: B** +**Answer: D** -It's possible to combine objects using the spread operator `...`. It lets you create copies of the key/value pairs of one object, and add them to another object. In this case, we create copies of the `user` object, and add them to the `admin` object. The `admin` object now contains the copied key/value pairs, which results in `{ admin: true, name: "Lydia", age: 21 }`. +First, we declare a variable `person` with the value of an object that has a `name` property. + + + +Then, we declare a variable called `members`. We set the first element of that array equal to the value of the `person` variable. Objects interact by _reference_ when setting them equal to each other. When you assign a reference from one variable to another, you make a _copy_ of that reference. (note that they don't have the _same_ reference!) + + + +Then, we set the variable `person` equal to `null`. + + + +We are only modifying the value of the `person` variable, and not the first element in the array, since that element has a different (copied) reference to the object. The first element in `members` still holds its reference to the original object. When we log the `members` array, the first element still holds the value of the object, which gets logged. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const person = { name: "Lydia" }; - -Object.defineProperty(person, "age", { value: 21 }); +const person = { + name: "Lydia", + age: 21, +}; -console.log(person); -console.log(Object.keys(person)); +for (const item in person) { + console.log(item); +} ``` -- A: `{ name: "Lydia", age: 21 }`, `["name", "age"]` -- B: `{ name: "Lydia", age: 21 }`, `["name"]` -- C: `{ name: "Lydia"}`, `["name", "age"]` -- D: `{ name: "Lydia"}`, `["age"]` +- A: `{ name: "Lydia" }, { age: 21 }` +- B: `"name", "age"` +- C: `"Lydia", 21` +- D: `["name", "Lydia"], ["age", 21]` **Answer: B** -With the `defineProperty` method, we can add new properties to an object, or modify existing ones. When we add a property to an object using the `defineProperty` method, they are by default _not enumerable_. The `Object.keys` method returns all _enumerable_ property names from an object, in this case only `"name"`. - -Properties added using the `defineProperty` method are immutable by default. You can override this behavior using the `writable`, `configurable` and `enumerable` properties. This way, the `defineProperty` method gives you a lot more control over the properties you're adding to an object. +With a `for-in` loop, we can iterate through object keys, in this case `name` and `age`. Under the hood, object keys are strings (if they're not a Symbol). On every loop, we set the value of `item` equal to the current key it’s iterating over. First, `item` is equal to `name`, and gets logged. Then, `item` is equal to `age`, which gets logged. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const settings = { - username: "lydiahallie", - level: 19, - health: 90, -}; - -const data = JSON.stringify(settings, ["level", "health"]); -console.log(data); +console.log(3 + 4 + "5"); ``` -- A: `"{"level":19, "health":90}"` -- B: `"{"username": "lydiahallie"}"` -- C: `"["level", "health"]"` -- D: `"{"username": "lydiahallie", "level":19, "health":90}"` +- A: `"345"` +- B: `"75"` +- C: `12` +- D: `"12"` -**Answer: A** +**Answer: B** -The second argument of `JSON.stringify` is the _replacer_. The replacer can either be a function or an array, and lets you control what and how the values should be stringified. +Operator associativity is the order in which the compiler evaluates the expressions, either left-to-right or right-to-left. This only happens if all operators have the _same_ precedence. We only have one type of operator: `+`. For addition, the associativity is left-to-right. -If the replacer is an _array_, only the property names included in the array will be added to the JSON string. In this case, only the properties with the names `"level"` and `"health"` are included, `"username"` is excluded. `data` is now equal to `"{"level":19, "health":90}"`. +`3 + 4` gets evaluated first. This results in the number `7`. -If the replacer is a _function_, this function gets called on every property in the object you're stringifying. The value returned from this function will be the value of the property when it's added to the JSON string. If the value is `undefined`, this property is excluded from the JSON string. +`7 + '5'` results in `"75"` because of coercion. JavaScript converts the number `7` into a string, see question 15. We can concatenate two strings using the `+`operator. `"7" + "5"` results in `"75"`. -## Q. ***What is the output?*** +## Q. What is the value of `num`? ```javascript -let num = 10; - -const increaseNumber = () => num++; -const increasePassedNumber = (number) => number++; - -const num1 = increaseNumber(); -const num2 = increasePassedNumber(num1); - -console.log(num1); -console.log(num2); +const num = parseInt("7*6", 10); ``` -- A: `10`, `10` -- B: `10`, `11` -- C: `11`, `11` -- D: `11`, `12` +- A: `42` +- B: `"42"` +- C: `7` +- D: `NaN` -**Answer: A** +**Answer: C** -The unary operator `++` _first returns_ the value of the operand, _then increments_ the value of the operand. The value of `num1` is `10`, since the `increaseNumber` function first returns the value of `num`, which is `10`, and only increments the value of `num` afterwards. +Only the first numbers in the string is returned. Based on the _radix_ (the second argument in order to specify what type of number we want to parse it to: base 10, hexadecimal, octal, binary, etc.), the `parseInt` checks whether the characters in the string are valid. Once it encounters a character that isn't a valid number in the radix, it stops parsing and ignores the following characters. -`num2` is `10`, since we passed `num1` to the `increasePassedNumber`. `number` is equal to `10`(the value of `num1`. Again, the unary operator `++` _first returns_ the value of the operand, _then increments_ the value of the operand. The value of `number` is `10`, so `num2` is equal to `10`. +`*` is not a valid number. It only parses `"7"` into the decimal `7`. `num` now holds the value of `7`. -## Q. ***What is the output?*** +## Q. What is the output`? ```javascript -const value = { number: 10 }; - -const multiply = (x = { ...value }) => { - console.log((x.number *= 2)); -}; - -multiply(); -multiply(); -multiply(value); -multiply(value); +[1, 2, 3].map((num) => { + if (typeof num === "number") return; + return num * 2; +}); ``` -- A: `20`, `40`, `80`, `160` -- B: `20`, `40`, `20`, `40` -- C: `20`, `20`, `20`, `40` -- D: `NaN`, `NaN`, `20`, `40` +- A: `[]` +- B: `[null, null, null]` +- C: `[undefined, undefined, undefined]` +- D: `[ 3 x empty ]` **Answer: C** -In ES6, we can initialize parameters with a default value. The value of the parameter will be the default value, if no other value has been passed to the function, or if the value of the parameter is `"undefined"`. In this case, we spread the properties of the `value` object into a new object, so `x` has the default value of `{ number: 10 }`. - -The default argument is evaluated at _call time_! Every time we call the function, a _new_ object is created. We invoke the `multiply` function the first two times without passing a value: `x` has the default value of `{ number: 10 }`. We then log the multiplied value of that number, which is `20`. - -The third time we invoke multiply, we do pass an argument: the object called `value`. The `*=` operator is actually shorthand for `x.number = x.number * 2`: we modify the value of `x.number`, and log the multiplied value `20`. +When mapping over the array, the value of `num` is equal to the element it’s currently looping over. In this case, the elements are numbers, so the condition of the if statement `typeof num === "number"` returns `true`. The map function creates a new array and inserts the values returned from the function. -The fourth time, we pass the `value` object again. `x.number` was previously modified to `20`, so `x.number *= 2` logs `40`. +However, we don’t return a value. When we don’t return a value from the function, the function returns `undefined`. For every element in the array, the function block gets called, so for each element we return `undefined`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -[1, 2, 3, 4].reduce((x, y) => console.log(x, y)); -``` - -- A: `1` `2` and `3` `3` and `6` `4` -- B: `1` `2` and `2` `3` and `3` `4` -- C: `1` `undefined` and `2` `undefined` and `3` `undefined` and `4` `undefined` -- D: `1` `2` and `undefined` `3` and `undefined` `4` +function getInfo(member, year) { + member.name = "Lydia"; + year = "1998"; +} -**Answer: D** +const person = { name: "Sarah" }; +const birthYear = "1997"; -The first argument that the `reduce` method receives is the _accumulator_, `x` in this case. The second argument is the _current value_, `y`. With the reduce method, we execute a callback function on every element in the array, which could ultimately result in one single value. +getInfo(person, birthYear); -In this example, we are not returning any values, we are simply logging the values of the accumulator and the current value. +console.log(person, birthYear); +``` -The value of the accumulator is equal to the previously returned value of the callback function. If you don't pass the optional `initialValue` argument to the `reduce` method, the accumulator is equal to the first element on the first call. +- A: `{ name: "Lydia" }, "1997"` +- B: `{ name: "Sarah" }, "1998"` +- C: `{ name: "Lydia" }, "1998"` +- D: `{ name: "Sarah" }, "1997"` -On the first call, the accumulator (`x`) is `1`, and the current value (`y`) is `2`. We don't return from the callback function, we log the accumulator and current value: `1` and `2` get logged. +**Answer: A** -If you don't return a value from a function, it returns `undefined`. On the next call, the accumulator is `undefined`, and the current value is `3`. `undefined` and `3` get logged. +Arguments are passed by _value_, unless their value is an object, then they're passed by _reference_. `birthYear` is passed by value, since it's a string, not an object. When we pass arguments by value, a _copy_ of that value is created (see question 46). -On the fourth call, we again don't return from the callback function. The accumulator is again `undefined`, and the current value is `4`. `undefined` and `4` get logged. +The variable `birthYear` has a reference to the value `"1997"`. The argument `year` also has a reference to the value `"1997"`, but it's not the same value as `birthYear` has a reference to. When we update the value of `year` by setting `year` equal to `"1998"`, we are only updating the value of `year`. `birthYear` is still equal to `"1997"`. -

- ---- +The value of `person` is an object. The argument `member` has a (copied) reference to the _same_ object. When we modify a property of the object `member` has a reference to, the value of `person` will also be modified, since they both have a reference to the same object. `person`'s `name` property is now equal to the value `"Lydia"` -## Q. ***With which constructor can we successfully extend the `Dog` class?*** +## Q. What is the output? ```javascript -class Dog { - constructor(name) { - this.name = name; - } +function greeting() { + throw "Hello world!"; } -class Labrador extends Dog { - // 1 - constructor(name, size) { - this.size = size; - } - // 2 - constructor(name, size) { - super(name); - this.size = size; - } - // 3 - constructor(size) { - super(name); - this.size = size; - } - // 4 - constructor(name, size) { - this.name = name; - this.size = size; +function sayHi() { + try { + const data = greeting(); + console.log("It worked!", data); + } catch (e) { + console.log("Oh no an error:", e); } } -``` -- A: 1 -- B: 2 -- C: 3 -- D: 4 +sayHi(); +``` -**Answer: B** +- A: `It worked! Hello world!` +- B: `Oh no an error: undefined` +- C: `SyntaxError: can only throw Error objects` +- D: `Oh no an error: Hello world!` -In a derived class, you cannot access the `this` keyword before calling `super`. If you try to do that, it will throw a ReferenceError: 1 and 4 would throw a reference error. +**Answer: D** -With the `super` keyword, we call that parent class's constructor with the given arguments. The parent's constructor receives the `name` argument, so we need to pass `name` to `super`. +With the `throw` statement, we can create custom errors. With this statement, you can throw exceptions. An exception can be a string, a number, a boolean or an object. In this case, our exception is the string `'Hello world'`. -The `Labrador` class receives two arguments, `name` since it extends `Dog`, and `size` as an extra property on the `Labrador` class. They both need to be passed to the constructor function on `Labrador`, which is done correctly using constructor 2. +With the `catch` statement, we can specify what to do if an exception is thrown in the `try` block. An exception is thrown: the string `'Hello world'`. `e` is now equal to that string, which we log. This results in `'Oh an error: Hello world'`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -// index.js -console.log("running index.js"); -import { sum } from "./sum.js"; -console.log(sum(1, 2)); +function Car() { + this.make = "Lamborghini"; + return { make: "Maserati" }; +} -// sum.js -console.log("running sum.js"); -export const sum = (a, b) => a + b; +const myCar = new Car(); +console.log(myCar.make); ``` -- A: `running index.js`, `running sum.js`, `3` -- B: `running sum.js`, `running index.js`, `3` -- C: `running sum.js`, `3`, `running index.js` -- D: `running index.js`, `undefined`, `running sum.js` +- A: `"Lamborghini"` +- B: `"Maserati"` +- C: `ReferenceError` +- D: `TypeError` **Answer: B** -With the `import` keyword, all imported modules are _pre-parsed_. This means that the imported modules get run _first_, the code in the file which imports the module gets executed _after_. - -This is a difference between `require()` in CommonJS and `import`! With `require()`, you can load dependencies on demand while the code is being run. If we would have used `require` instead of `import`, `running index.js`, `running sum.js`, `3` would have been logged to the console. +When you return a property, the value of the property is equal to the _returned_ value, not the value set in the constructor function. We return the string `"Maserati"`, so `myCar.make` is equal to `"Maserati"`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -console.log(Number(2) === Number(2)); -console.log(Boolean(false) === Boolean(false)); -console.log(Symbol("foo") === Symbol("foo")); +(() => { + let x = (y = 10); +})(); + +console.log(typeof x); +console.log(typeof y); ``` -- A: `true`, `true`, `false` -- B: `false`, `true`, `false` -- C: `true`, `false`, `true` -- D: `true`, `true`, `true` +- A: `"undefined", "number"` +- B: `"number", "number"` +- C: `"object", "number"` +- D: `"number", "undefined"` **Answer: A** -Every Symbol is entirely unique. The purpose of the argument passed to the Symbol is to give the Symbol a description. The value of the Symbol is not dependent on the passed argument. As we test equality, we are creating two entirely new symbols: the first `Symbol('foo')`, and the second `Symbol('foo')`. These two values are unique and not equal to each other, `Symbol('foo') === Symbol('foo')` returns `false`. - - - -## Q. ***What is the output?*** +`let x = y = 10;` is actually shorthand for: ```javascript -const name = "Lydia Hallie"; -console.log(name.padStart(13)); -console.log(name.padStart(2)); +y = 10; +let x = y; ``` -- A: `"Lydia Hallie"`, `"Lydia Hallie"` -- B: `" Lydia Hallie"`, `" Lydia Hallie"` (`"[13x whitespace]Lydia Hallie"`, `"[2x whitespace]Lydia Hallie"`) -- C: `" Lydia Hallie"`, `"Lydia Hallie"` (`"[1x whitespace]Lydia Hallie"`, `"Lydia Hallie"`) -- D: `"Lydia Hallie"`, `"Lyd"`, - -**Answer: C** +When we set `y` equal to `10`, we actually add a property `y` to the global object (`window` in browser, `global` in Node). In a browser, `window.y` is now equal to `10`. -With the `padStart` method, we can add padding to the beginning of a string. The value passed to this method is the _total_ length of the string together with the padding. The string `"Lydia Hallie"` has a length of `12`. `name.padStart(13)` inserts 1 space at the start of the string, because 12 + 1 is 13. +Then, we declare a variable `x` with the value of `y`, which is `10`. Variables declared with the `let` keyword are _block scoped_, they are only defined within the block they're declared in; the immediately-invoked function (IIFE) in this case. When we use the `typeof` operator, the operand `x` is not defined: we are trying to access `x` outside of the block it's declared in. This means that `x` is not defined. Values who haven't been assigned a value or declared are of type `"undefined"`. `console.log(typeof x)` returns `"undefined"`. -If the argument passed to the `padStart` method is smaller than the length of the array, no padding will be added. +However, we created a global variable `y` when setting `y` equal to `10`. This value is accessible anywhere in our code. `y` is defined, and holds a value of type `"number"`. `console.log(typeof y)` returns `"number"`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -console.log("🥑" + "💻"); +class Dog { + constructor(name) { + this.name = name; + } +} + +Dog.prototype.bark = function () { + console.log(`Woof I am ${this.name}`); +}; + +const pet = new Dog("Mara"); + +pet.bark(); + +delete Dog.prototype.bark; + +pet.bark(); ``` -- A: `"🥑💻"` -- B: `257548` -- C: A string containing their code points -- D: Error +- A: `"Woof I am Mara"`, `TypeError` +- B: `"Woof I am Mara"`, `"Woof I am Mara"` +- C: `"Woof I am Mara"`, `undefined` +- D: `TypeError`, `TypeError` **Answer: A** -With the `+` operator, you can concatenate strings. In this case, we are concatenating the string `"🥑"` with the string `"💻"`, resulting in `"🥑💻"`. +We can delete properties from objects using the `delete` keyword, also on the prototype. By deleting a property on the prototype, it is not available anymore in the prototype chain. In this case, the `bark` function is not available anymore on the prototype after `delete Dog.prototype.bark`, yet we still try to access it. + +When we try to invoke something that is not a function, a `TypeError` is thrown. In this case `TypeError: pet.bark is not a function`, since `pet.bark` is `undefined`. -## Q. ***How can we log the values that are commented out after the console.log statement?*** +## Q. What is the output? ```javascript -function* startGame() { - const answer = yield "Do you love JavaScript?"; - if (answer !== "Yes") { - return "Oh wow... Guess we're gone here"; - } - return "JavaScript loves you back ❤️"; -} +const set = new Set([1, 1, 2, 3, 4]); -const game = startGame(); -console.log(/* 1 */); // Do you love JavaScript? -console.log(/* 2 */); // JavaScript loves you back ❤️ +console.log(set); ``` -- A: `game.next("Yes").value` and `game.next().value` -- B: `game.next.value("Yes")` and `game.next.value()` -- C: `game.next().value` and `game.next("Yes").value` -- D: `game.next.value()` and `game.next.value("Yes")` - -**Answer: C** +- A: `[1, 1, 2, 3, 4]` +- B: `[1, 2, 3, 4]` +- C: `{1, 1, 2, 3, 4}` +- D: `{1, 2, 3, 4}` -A generator function "pauses" its execution when it sees the `yield` keyword. First, we have to let the function yield the string "Do you love JavaScript?", which can be done by calling `game.next().value`. +**Answer: D** -Every line is executed, until it finds the first `yield` keyword. There is a `yield` keyword on the first line within the function: the execution stops with the first yield! _This means that the variable `answer` is not defined yet!_ +The `Set` object is a collection of _unique_ values: a value can only occur once in a set. -When we call `game.next("Yes").value`, the previous `yield` is replaced with the value of the parameters passed to the `next()` function, `"Yes"` in this case. The value of the variable `answer` is now equal to `"Yes"`. The condition of the if-statement returns `false`, and `JavaScript loves you back ❤️` gets logged. +We passed the iterable `[1, 1, 2, 3, 4]` with a duplicate value `1`. Since we cannot have two of the same values in a set, one of them is removed. This results in `{1, 2, 3, 4}`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -console.log(String.raw`Hello\nworld`); +// counter.js +let counter = 10; +export default counter; ``` -- A: `Hello world!` -- B: `Hello`
     `world` -- C: `Hello\nworld` -- D: `Hello\n`
     `world` - -**Answer: C** - -`String.raw` returns a string where the escapes (`\n`, `\v`, `\t` etc.) are ignored! Backslashes can be an issue since you could end up with something like: +```javascript +// index.js +import myCounter from "./counter"; -`` const path = `C:\Documents\Projects\table.html` `` +myCounter += 1; -Which would result in: +console.log(myCounter); +``` -`"C:DocumentsProjects able.html"` +- A: `10` +- B: `11` +- C: `Error` +- D: `NaN` -With `String.raw`, it would simply ignore the escape and print: +**Answer: C** -`C:\Documents\Projects\table.html` +An imported module is _read-only_: you cannot modify the imported module. Only the module that exports them can change its value. -In this case, the string is `Hello\nworld`, which gets logged. +When we try to increment the value of `myCounter`, it throws an error: `myCounter` is read-only and cannot be modified. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -async function getData() { - return await Promise.resolve("I made it!"); -} +const name = "Lydia"; +age = 21; -const data = getData(); -console.log(data); +console.log(delete name); +console.log(delete age); ``` -- A: `"I made it!"` -- B: `Promise {: "I made it!"}` -- C: `Promise {}` -- D: `undefined` - -**Answer: C** - -An async function always returns a promise. The `await` still has to wait for the promise to resolve: a pending promise gets returned when we call `getData()` in order to set `data` equal to it. +- A: `false`, `true` +- B: `"Lydia"`, `21` +- C: `true`, `true` +- D: `undefined`, `undefined` -If we wanted to get access to the resolved value `"I made it"`, we could have used the `.then()` method on `data`: +**Answer: A** -`data.then(res => console.log(res))` +The `delete` operator returns a boolean value: `true` on a successful deletion, else it'll return `false`. However, variables declared with the `var`, `const` or `let` keyword cannot be deleted using the `delete` operator. -This would've logged `"I made it!"` +The `name` variable was declared with a `const` keyword, so its deletion is not successful: `false` is returned. When we set `age` equal to `21`, we actually added a property called `age` to the global object. You can successfully delete properties from objects this way, also the global object, so `delete age` returns `true`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -function addToList(item, list) { - return list.push(item); -} +const numbers = [1, 2, 3, 4, 5]; +const [y] = numbers; -const result = addToList("apple", ["banana"]); -console.log(result); +console.log(y); ``` -- A: `['apple', 'banana']` -- B: `2` -- C: `true` -- D: `undefined` +- A: `[[1, 2, 3, 4, 5]]` +- B: `[1, 2, 3, 4, 5]` +- C: `1` +- D: `[1]` -**Answer: B** +**Answer: C** -The `.push()` method returns the _length_ of the new array! Previously, the array contained one element (the string `"banana"`) and had a length of `1`. After adding the string `"apple"` to the array, the array contains two elements, and has a length of `2`. This gets returned from the `addToList` function. +We can unpack values from arrays or properties from objects through destructuring. For example: -The `push` method modifies the original array. If you wanted to return the _array_ from the function rather than the _length of the array_, you should have returned `list` after pushing `item` to it. +```javascript +[a, b] = [1, 2]; +``` + + + +The value of `a` is now `1`, and the value of `b` is now `2`. What we actually did in the question, is: + +```javascript +[y] = [1, 2, 3, 4, 5]; +``` + + + +This means that the value of `y` is equal to the first value in the array, which is the number `1`. When we log `y`, `1` is returned. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const box = { x: 10, y: 20 }; - -Object.freeze(box); - -const shape = box; -shape.x = 100; +const user = { name: "Lydia", age: 21 }; +const admin = { admin: true, ...user }; -console.log(shape); +console.log(admin); ``` -- A: `{ x: 100, y: 20 }` -- B: `{ x: 10, y: 20 }` -- C: `{ x: 100 }` -- D: `ReferenceError` +- A: `{ admin: true, user: { name: "Lydia", age: 21 } }` +- B: `{ admin: true, name: "Lydia", age: 21 }` +- C: `{ admin: true, user: ["Lydia", 21] }` +- D: `{ admin: true }` **Answer: B** -`Object.freeze` makes it impossible to add, remove, or modify properties of an object (unless the property's value is another object). - -When we create the variable `shape` and set it equal to the frozen object `box`, `shape` also refers to a frozen object. You can check whether an object is frozen by using `Object.isFrozen`. In this case, `Object.isFrozen(shape)` returns true, since the variable `shape` has a reference to a frozen object. - -Since `shape` is frozen, and since the value of `x` is not an object, we cannot modify the property `x`. `x` is still equal to `10`, and `{ x: 10, y: 20 }` gets logged. +It's possible to combine objects using the spread operator `...`. It lets you create copies of the key/value pairs of one object, and add them to another object. In this case, we create copies of the `user` object, and add them to the `admin` object. The `admin` object now contains the copied key/value pairs, which results in `{ admin: true, name: "Lydia", age: 21 }`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const { name: myName } = { name: "Lydia" }; +const person = { name: "Lydia" }; -console.log(name); -``` +Object.defineProperty(person, "age", { value: 21 }); -- A: `"Lydia"` -- B: `"myName"` -- C: `undefined` -- D: `ReferenceError` +console.log(person); +console.log(Object.keys(person)); +``` -**Answer: D** +- A: `{ name: "Lydia", age: 21 }`, `["name", "age"]` +- B: `{ name: "Lydia", age: 21 }`, `["name"]` +- C: `{ name: "Lydia"}`, `["name", "age"]` +- D: `{ name: "Lydia"}`, `["age"]` -When we unpack the property `name` from the object on the right-hand side, we assign its value `"Lydia"` to a variable with the name `myName`. +**Answer: B** -With `{ name: myName }`, we tell JavaScript that we want to create a new variable called `myName` with the value of the `name` property on the right-hand side. +With the `defineProperty` method, we can add new properties to an object, or modify existing ones. When we add a property to an object using the `defineProperty` method, they are by default _not enumerable_. The `Object.keys` method returns all _enumerable_ property names from an object, in this case only `"name"`. -Since we try to log `name`, a variable that is not defined, a ReferenceError gets thrown. +Properties added using the `defineProperty` method are immutable by default. You can override this behavior using the `writable`, `configurable` and `enumerable` properties. This way, the `defineProperty` method gives you a lot more control over the properties you're adding to an object. -## Q. ***Is this a pure function?*** +## Q. What is the output? ```javascript -function sum(a, b) { - return a + b; -} +const settings = { + username: "lydiahallie", + level: 19, + health: 90, +}; + +const data = JSON.stringify(settings, ["level", "health"]); +console.log(data); ``` -- A: Yes -- B: No +- A: `"{"level":19, "health":90}"` +- B: `"{"username": "lydiahallie"}"` +- C: `"["level", "health"]"` +- D: `"{"username": "lydiahallie", "level":19, "health":90}"` **Answer: A** -A pure function is a function that _always_ returns the same result, if the same arguments are passed. +The second argument of `JSON.stringify` is the _replacer_. The replacer can either be a function or an array, and lets you control what and how the values should be stringified. -The `sum` function always returns the same result. If we pass `1` and `2`, it will _always_ return `3` without side effects. If we pass `5` and `10`, it will _always_ return `15`, and so on. This is the definition of a pure function. +If the replacer is an _array_, only the property names included in the array will be added to the JSON string. In this case, only the properties with the names `"level"` and `"health"` are included, `"username"` is excluded. `data` is now equal to `"{"level":19, "health":90}"`. + +If the replacer is a _function_, this function gets called on every property in the object you're stringifying. The value returned from this function will be the value of the property when it's added to the JSON string. If the value is `undefined`, this property is excluded from the JSON string. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const add = () => { - const cache = {}; - return (num) => { - if (num in cache) { - return `From cache! ${cache[num]}`; - } else { - const result = num + 10; - cache[num] = result; - return `Calculated! ${result}`; - } - }; -}; - -const addFunction = add(); -console.log(addFunction(10)); -console.log(addFunction(10)); -console.log(addFunction(5 * 2)); -``` +let num = 10; -- A: `Calculated! 20` `Calculated! 20` `Calculated! 20` -- B: `Calculated! 20` `From cache! 20` `Calculated! 20` -- C: `Calculated! 20` `From cache! 20` `From cache! 20` -- D: `Calculated! 20` `From cache! 20` `Error` +const increaseNumber = () => num++; +const increasePassedNumber = (number) => number++; -**Answer: C** +const num1 = increaseNumber(); +const num2 = increasePassedNumber(num1); -The `add` function is a _memoized_ function. With memoization, we can cache the results of a function in order to speed up its execution. In this case, we create a `cache` object that stores the previously returned values. +console.log(num1); +console.log(num2); +``` -If we call the `addFunction` function again with the same argument, it first checks whether it has already gotten that value in its cache. If that's the case, the caches value will be returned, which saves on execution time. Else, if it's not cached, it will calculate the value and store it afterwards. +- A: `10`, `10` +- B: `10`, `11` +- C: `11`, `11` +- D: `11`, `12` -We call the `addFunction` function three times with the same value: on the first invocation, the value of the function when `num` is equal to `10` isn't cached yet. The condition of the if-statement `num in cache` returns `false`, and the else block gets executed: `Calculated! 20` gets logged, and the value of the result gets added to the cache object. `cache` now looks like `{ 10: 20 }`. +**Answer: A** -The second time, the `cache` object contains the value that gets returned for `10`. The condition of the if-statement `num in cache` returns `true`, and `'From cache! 20'` gets logged. +The unary operator `++` _first returns_ the value of the operand, _then increments_ the value of the operand. The value of `num1` is `10`, since the `increaseNumber` function first returns the value of `num`, which is `10`, and only increments the value of `num` afterwards. -The third time, we pass `5 * 2` to the function which gets evaluated to `10`. The `cache` object contains the value that gets returned for `10`. The condition of the if-statement `num in cache` returns `true`, and `'From cache! 20'` gets logged. +`num2` is `10`, since we passed `num1` to the `increasePassedNumber`. `number` is equal to `10`(the value of `num1`. Again, the unary operator `++` _first returns_ the value of the operand, _then increments_ the value of the operand. The value of `number` is `10`, so `num2` is equal to `10`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const myLifeSummedUp = ["☕", "💻", "🍷", "🍫"]; +const value = { number: 10 }; -for (let item in myLifeSummedUp) { - console.log(item); -} +const multiply = (x = { ...value }) => { + console.log((x.number *= 2)); +}; -for (let item of myLifeSummedUp) { - console.log(item); -} +multiply(); +multiply(); +multiply(value); +multiply(value); ``` -- A: `0` `1` `2` `3` and `"☕"` ` "💻"` `"🍷"` `"🍫"` -- B: `"☕"` ` "💻"` `"🍷"` `"🍫"` and `"☕"` ` "💻"` `"🍷"` `"🍫"` -- C: `"☕"` ` "💻"` `"🍷"` `"🍫"` and `0` `1` `2` `3` -- D: `0` `1` `2` `3` and `{0: "☕", 1: "💻", 2: "🍷", 3: "🍫"}` +- A: `20`, `40`, `80`, `160` +- B: `20`, `40`, `20`, `40` +- C: `20`, `20`, `20`, `40` +- D: `NaN`, `NaN`, `20`, `40` -**Answer: A** +**Answer: C** -With a _for-in_ loop, we can iterate over **enumerable** properties. In an array, the enumerable properties are the "keys" of array elements, which are actually their indexes. You could see an array as: +In ES6, we can initialize parameters with a default value. The value of the parameter will be the default value, if no other value has been passed to the function, or if the value of the parameter is `"undefined"`. In this case, we spread the properties of the `value` object into a new object, so `x` has the default value of `{ number: 10 }`. -`{0: "☕", 1: "💻", 2: "🍷", 3: "🍫"}` +The default argument is evaluated at _call time_! Every time we call the function, a _new_ object is created. We invoke the `multiply` function the first two times without passing a value: `x` has the default value of `{ number: 10 }`. We then log the multiplied value of that number, which is `20`. -Where the keys are the enumerable properties. `0` `1` `2` `3` get logged. +The third time we invoke multiply, we do pass an argument: the object called `value`. The `*=` operator is actually shorthand for `x.number = x.number * 2`: we modify the value of `x.number`, and log the multiplied value `20`. -With a _for-of_ loop, we can iterate over **iterables**. An array is an iterable. When we iterate over the array, the variable "item" is equal to the element it's currently iterating over, `"☕"` ` "💻"` `"🍷"` `"🍫"` get logged. +The fourth time, we pass the `value` object again. `x.number` was previously modified to `20`, so `x.number *= 2` logs `40`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const list = [1 + 2, 1 * 2, 1 / 2]; -console.log(list); +[1, 2, 3, 4].reduce((x, y) => console.log(x, y)); ``` -- A: `["1 + 2", "1 * 2", "1 / 2"]` -- B: `["12", 2, 0.5]` -- C: `[3, 2, 0.5]` -- D: `[1, 1, 1]` +- A: `1` `2` and `3` `3` and `6` `4` +- B: `1` `2` and `2` `3` and `3` `4` +- C: `1` `undefined` and `2` `undefined` and `3` `undefined` and `4` `undefined` +- D: `1` `2` and `undefined` `3` and `undefined` `4` -**Answer: C** +**Answer: D** -Array elements can hold any value. Numbers, strings, objects, other arrays, null, boolean values, undefined, and other expressions such as dates, functions, and calculations. +The first argument that the `reduce` method receives is the _accumulator_, `x` in this case. The second argument is the _current value_, `y`. With the reduce method, we execute a callback function on every element in the array, which could ultimately result in one single value. -The element will be equal to the returned value. `1 + 2` returns `3`, `1 * 2` returns `2`, and `1 / 2` returns `0.5`. +In this example, we are not returning any values, we are simply logging the values of the accumulator and the current value. + +The value of the accumulator is equal to the previously returned value of the callback function. If you don't pass the optional `initialValue` argument to the `reduce` method, the accumulator is equal to the first element on the first call. + +On the first call, the accumulator (`x`) is `1`, and the current value (`y`) is `2`. We don't return from the callback function, we log the accumulator and current value: `1` and `2` get logged. + +If you don't return a value from a function, it returns `undefined`. On the next call, the accumulator is `undefined`, and the current value is `3`. `undefined` and `3` get logged. + +On the fourth call, we again don't return from the callback function. The accumulator is again `undefined`, and the current value is `4`. `undefined` and `4` get logged. + +

+ +--- -## Q. ***What is the output?*** +## Q. With which constructor can we successfully extend the `Dog` class? ```javascript -function sayHi(name) { - return `Hi there, ${name}`; +class Dog { + constructor(name) { + this.name = name; + } } -console.log(sayHi()); +class Labrador extends Dog { + // 1 + constructor(name, size) { + this.size = size; + } + // 2 + constructor(name, size) { + super(name); + this.size = size; + } + // 3 + constructor(size) { + super(name); + this.size = size; + } + // 4 + constructor(name, size) { + this.name = name; + this.size = size; + } +} ``` -- A: `Hi there, ` -- B: `Hi there, undefined` -- C: `Hi there, null` -- D: `ReferenceError` +- A: 1 +- B: 2 +- C: 3 +- D: 4 **Answer: B** -By default, arguments have the value of `undefined`, unless a value has been passed to the function. In this case, we didn't pass a value for the `name` argument. `name` is equal to `undefined` which gets logged. - -In ES6, we can overwrite this default `undefined` value with default parameters. For example: +In a derived class, you cannot access the `this` keyword before calling `super`. If you try to do that, it will throw a ReferenceError: 1 and 4 would throw a reference error. -`function sayHi(name = "Lydia") { ... }` +With the `super` keyword, we call that parent class's constructor with the given arguments. The parent's constructor receives the `name` argument, so we need to pass `name` to `super`. -In this case, if we didn't pass a value or if we passed `undefined`, `name` would always be equal to the string `Lydia` +The `Labrador` class receives two arguments, `name` since it extends `Dog`, and `size` as an extra property on the `Labrador` class. They both need to be passed to the constructor function on `Labrador`, which is done correctly using constructor 2. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -var status = "😎"; - -setTimeout(() => { - const status = "😍"; - - const data = { - status: "🥑", - getStatus() { - return this.status; - }, - }; +// index.js +console.log("running index.js"); +import { sum } from "./sum.js"; +console.log(sum(1, 2)); - console.log(data.getStatus()); - console.log(data.getStatus.call(this)); -}, 0); +// sum.js +console.log("running sum.js"); +export const sum = (a, b) => a + b; ``` -- A: `"🥑"` and `"😍"` -- B: `"🥑"` and `"😎"` -- C: `"😍"` and `"😎"` -- D: `"😎"` and `"😎"` +- A: `running index.js`, `running sum.js`, `3` +- B: `running sum.js`, `running index.js`, `3` +- C: `running sum.js`, `3`, `running index.js` +- D: `running index.js`, `undefined`, `running sum.js` **Answer: B** -The value of the `this` keyword is dependent on where you use it. In a **method**, like the `getStatus` method, the `this` keyword refers to _the object that the method belongs to_. The method belongs to the `data` object, so `this` refers to the `data` object. When we log `this.status`, the `status` property on the `data` object gets logged, which is `"🥑"`. +With the `import` keyword, all imported modules are _pre-parsed_. This means that the imported modules get run _first_, the code in the file which imports the module gets executed _after_. -With the `call` method, we can change the object to which the `this` keyword refers. In **functions**, the `this` keyword refers to the _the object that the function belongs to_. We declared the `setTimeout` function on the _global object_, so within the `setTimeout` function, the `this` keyword refers to the _global object_. On the global object, there is a variable called _status_ with the value of `"😎"`. When logging `this.status`, `"😎"` gets logged. +This is a difference between `require()` in CommonJS and `import`! With `require()`, you can load dependencies on demand while the code is being run. If we would have used `require` instead of `import`, `running index.js`, `running sum.js`, `3` would have been logged to the console. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const person = { - name: "Lydia", - age: 21, -}; - -let city = person.city; -city = "Amsterdam"; - -console.log(person); +console.log(Number(2) === Number(2)); +console.log(Boolean(false) === Boolean(false)); +console.log(Symbol("foo") === Symbol("foo")); ``` -- A: `{ name: "Lydia", age: 21 }` -- B: `{ name: "Lydia", age: 21, city: "Amsterdam" }` -- C: `{ name: "Lydia", age: 21, city: undefined }` -- D: `"Amsterdam"` +- A: `true`, `true`, `false` +- B: `false`, `true`, `false` +- C: `true`, `false`, `true` +- D: `true`, `true`, `true` **Answer: A** -We set the variable `city` equal to the value of the property called `city` on the `person` object. There is no property on this object called `city`, so the variable `city` has the value of `undefined`. - -Note that we are _not_ referencing the `person` object itself! We simply set the variable `city` equal to the current value of the `city` property on the `person` object. - -Then, we set `city` equal to the string `"Amsterdam"`. This doesn't change the person object: there is no reference to that object. - -When logging the `person` object, the unmodified object gets returned. +Every Symbol is entirely unique. The purpose of the argument passed to the Symbol is to give the Symbol a description. The value of the Symbol is not dependent on the passed argument. As we test equality, we are creating two entirely new symbols: the first `Symbol('foo')`, and the second `Symbol('foo')`. These two values are unique and not equal to each other, `Symbol('foo') === Symbol('foo')` returns `false`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -function checkAge(age) { - if (age < 18) { - const message = "Sorry, you're too young."; - } else { - const message = "Yay! You're old enough!"; - } - - return message; -} - -console.log(checkAge(21)); +const name = "Lydia Hallie"; +console.log(name.padStart(13)); +console.log(name.padStart(2)); ``` -- A: `"Sorry, you're too young."` -- B: `"Yay! You're old enough!"` -- C: `ReferenceError` -- D: `undefined` +- A: `"Lydia Hallie"`, `"Lydia Hallie"` +- B: `" Lydia Hallie"`, `" Lydia Hallie"` (`"[13x whitespace]Lydia Hallie"`, `"[2x whitespace]Lydia Hallie"`) +- C: `" Lydia Hallie"`, `"Lydia Hallie"` (`"[1x whitespace]Lydia Hallie"`, `"Lydia Hallie"`) +- D: `"Lydia Hallie"`, `"Lyd"`, **Answer: C** -Variables with the `const` and `let` keyword are _block-scoped_. A block is anything between curly brackets (`{ }`). In this case, the curly brackets of the if/else statements. You cannot reference a variable outside of the block it's declared in, a ReferenceError gets thrown. +With the `padStart` method, we can add padding to the beginning of a string. The value passed to this method is the _total_ length of the string together with the padding. The string `"Lydia Hallie"` has a length of `12`. `name.padStart(13)` inserts 1 space at the start of the string, because 12 + 1 is 13. + +If the argument passed to the `padStart` method is smaller than the length of the array, no padding will be added. -## Q. ***What kind of information would get logged?*** +## Q. What is the output? ```javascript -fetch("https://www.website.com/api/user/1") - .then((res) => res.json()) - .then((res) => console.log(res)); +console.log("🥑" + "💻"); ``` -- A: The result of the `fetch` method. -- B: The result of the second invocation of the `fetch` method. -- C: The result of the callback in the previous `.then()`. -- D: It would always be undefined. +- A: `"🥑💻"` +- B: `257548` +- C: A string containing their code points +- D: Error -**Answer: C** +**Answer: A** -The value of `res` in the second `.then` is equal to the returned value of the previous `.then`. You can keep chaining `.then`s like this, where the value is passed to the next handler. +With the `+` operator, you can concatenate strings. In this case, we are concatenating the string `"🥑"` with the string `"💻"`, resulting in `"🥑💻"`. -## Q. ***Which option is a way to set `hasName` equal to `true`, provided you cannot pass `true` as an argument?*** +## Q. How can we log the values that are commented out after the console.log statement? ```javascript -function getName(name) { - const hasName = // +function* startGame() { + const answer = yield "Do you love JavaScript?"; + if (answer !== "Yes") { + return "Oh wow... Guess we're gone here"; + } + return "JavaScript loves you back ❤️"; } -``` -- A: `!!name` -- B: `name` -- C: `new Boolean(name)` -- D: `name.length` +const game = startGame(); +console.log(/* 1 */); // Do you love JavaScript? +console.log(/* 2 */); // JavaScript loves you back ❤️ +``` -**Answer: A** +- A: `game.next("Yes").value` and `game.next().value` +- B: `game.next.value("Yes")` and `game.next.value()` +- C: `game.next().value` and `game.next("Yes").value` +- D: `game.next.value()` and `game.next.value("Yes")` -With `!!name`, we determine whether the value of `name` is truthy or falsy. If name is truthy, which we want to test for, `!name` returns `false`. `!false` (which is what `!!name` practically is) returns `true`. +**Answer: C** -By setting `hasName` equal to `name`, you set `hasName` equal to whatever value you passed to the `getName` function, not the boolean value `true`. +A generator function "pauses" its execution when it sees the `yield` keyword. First, we have to let the function yield the string "Do you love JavaScript?", which can be done by calling `game.next().value`. -`new Boolean(true)` returns an object wrapper, not the boolean value itself. +Every line is executed, until it finds the first `yield` keyword. There is a `yield` keyword on the first line within the function: the execution stops with the first yield! _This means that the variable `answer` is not defined yet!_ -`name.length` returns the length of the passed argument, not whether it's `true`. +When we call `game.next("Yes").value`, the previous `yield` is replaced with the value of the parameters passed to the `next()` function, `"Yes"` in this case. The value of the variable `answer` is now equal to `"Yes"`. The condition of the if-statement returns `false`, and `JavaScript loves you back ❤️` gets logged. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -console.log("I want pizza"[0]); +console.log(String.raw`Hello\nworld`); ``` -- A: `"""` -- B: `"I"` -- C: `SyntaxError` -- D: `undefined` +- A: `Hello world!` +- B: `Hello`
     `world` +- C: `Hello\nworld` +- D: `Hello\n`
     `world` -**Answer: B** +**Answer: C** -In order to get an character on a specific index in a string, you can use bracket notation. The first character in the string has index 0, and so on. In this case we want to get the element which index is 0, the character `"I'`, which gets logged. +`String.raw` returns a string where the escapes (`\n`, `\v`, `\t` etc.) are ignored! Backslashes can be an issue since you could end up with something like: -Note that this method is not supported in IE7 and below. In that case, use `.charAt()` +`` const path = `C:\Documents\Projects\table.html` `` + +Which would result in: + +`"C:DocumentsProjects able.html"` + +With `String.raw`, it would simply ignore the escape and print: + +`C:\Documents\Projects\table.html` + +In this case, the string is `Hello\nworld`, which gets logged. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -function sum(num1, num2 = num1) { - console.log(num1 + num2); +async function getData() { + return await Promise.resolve("I made it!"); } -sum(10); +const data = getData(); +console.log(data); ``` -- A: `NaN` -- B: `20` -- C: `ReferenceError` +- A: `"I made it!"` +- B: `Promise {: "I made it!"}` +- C: `Promise {}` - D: `undefined` -**Answer: B** +**Answer: C** -You can set a default parameter's value equal to another parameter of the function, as long as they've been defined _before_ the default parameter. We pass the value `10` to the `sum` function. If the `sum` function only receives 1 argument, it means that the value for `num2` is not passed, and the value of `num1` is equal to the passed value `10` in this case. The default value of `num2` is the value of `num1`, which is `10`. `num1 + num2` returns `20`. +An async function always returns a promise. The `await` still has to wait for the promise to resolve: a pending promise gets returned when we call `getData()` in order to set `data` equal to it. -If you're trying to set a default parameter's value equal to a parameter which is defined _after_ (to the right), the parameter's value hasn't been initialized yet, which will throw an error. +If we wanted to get access to the resolved value `"I made it"`, we could have used the `.then()` method on `data`: + +`data.then(res => console.log(res))` + +This would've logged `"I made it!"` -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -// module.js -export default () => "Hello world"; -export const name = "Lydia"; - -// index.js -import * as data from "./module"; +function addToList(item, list) { + return list.push(item); +} -console.log(data); +const result = addToList("apple", ["banana"]); +console.log(result); ``` -- A: `{ default: function default(), name: "Lydia" }` -- B: `{ default: function default() }` -- C: `{ default: "Hello world", name: "Lydia" }` -- D: Global object of `module.js` +- A: `['apple', 'banana']` +- B: `2` +- C: `true` +- D: `undefined` -**Answer: A** +**Answer: B** -With the `import * as name` syntax, we import _all exports_ from the `module.js` file into the `index.js` file as a new object called `data` is created. In the `module.js` file, there are two exports: the default export, and a named export. The default export is a function which returns the string `"Hello World"`, and the named export is a variable called `name` which has the value of the string `"Lydia"`. +The `.push()` method returns the _length_ of the new array! Previously, the array contained one element (the string `"banana"`) and had a length of `1`. After adding the string `"apple"` to the array, the array contains two elements, and has a length of `2`. This gets returned from the `addToList` function. -The `data` object has a `default` property for the default export, other properties have the names of the named exports and their corresponding values. +The `push` method modifies the original array. If you wanted to return the _array_ from the function rather than the _length of the array_, you should have returned `list` after pushing `item` to it. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -class Person { - constructor(name) { - this.name = name; - } -} +const box = { x: 10, y: 20 }; -const member = new Person("John"); -console.log(typeof member); +Object.freeze(box); + +const shape = box; +shape.x = 100; + +console.log(shape); ``` -- A: `"class"` -- B: `"function"` -- C: `"object"` -- D: `"string"` +- A: `{ x: 100, y: 20 }` +- B: `{ x: 10, y: 20 }` +- C: `{ x: 100 }` +- D: `ReferenceError` -**Answer: C** +**Answer: B** -Classes are syntactical sugar for function constructors. The equivalent of the `Person` class as a function constructor would be: +`Object.freeze` makes it impossible to add, remove, or modify properties of an object (unless the property's value is another object). -```javascript -function Person() { - this.name = name; -} -``` +When we create the variable `shape` and set it equal to the frozen object `box`, `shape` also refers to a frozen object. You can check whether an object is frozen by using `Object.isFrozen`. In this case, `Object.isFrozen(shape)` returns true, since the variable `shape` has a reference to a frozen object. -Calling a function constructor with `new` results in the creation of an instance of `Person`, `typeof` keyword returns `"object"` for an instance. `typeof member` returns `"object"`. +Since `shape` is frozen, and since the value of `x` is not an object, we cannot modify the property `x`. `x` is still equal to `10`, and `{ x: 10, y: 20 }` gets logged. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -let newList = [1, 2, 3].push(4); +const { name: myName } = { name: "Lydia" }; -console.log(newList.push(5)); +console.log(name); ``` -- A: `[1, 2, 3, 4, 5]` -- B: `[1, 2, 3, 5]` -- C: `[1, 2, 3, 4]` -- D: `Error` +- A: `"Lydia"` +- B: `"myName"` +- C: `undefined` +- D: `ReferenceError` **Answer: D** -The `.push` method returns the _new length_ of the array, not the array itself! By setting `newList` equal to `[1, 2, 3].push(4)`, we set `newList` equal to the new length of the array: `4`. +When we unpack the property `name` from the object on the right-hand side, we assign its value `"Lydia"` to a variable with the name `myName`. -Then, we try to use the `.push` method on `newList`. Since `newList` is the numerical value `4`, we cannot use the `.push` method: a TypeError is thrown. +With `{ name: myName }`, we tell JavaScript that we want to create a new variable called `myName` with the value of the `name` property on the right-hand side. + +Since we try to log `name`, a variable that is not defined, a ReferenceError gets thrown. -## Q. ***What is the output?*** +## Q. Is this a pure function? ```javascript -function giveLydiaPizza() { - return "Here is pizza!"; +function sum(a, b) { + return a + b; } - -const giveLydiaChocolate = () => - "Here's chocolate... now go hit the gym already."; - -console.log(giveLydiaPizza.prototype); -console.log(giveLydiaChocolate.prototype); ``` -- A: `{ constructor: ...}` `{ constructor: ...}` -- B: `{}` `{ constructor: ...}` -- C: `{ constructor: ...}` `{}` -- D: `{ constructor: ...}` `undefined` +- A: Yes +- B: No -**Answer: D** +**Answer: A** -Regular functions, such as the `giveLydiaPizza` function, have a `prototype` property, which is an object (prototype object) with a `constructor` property. Arrow functions however, such as the `giveLydiaChocolate` function, do not have this `prototype` property. `undefined` gets returned when trying to access the `prototype` property using `giveLydiaChocolate.prototype`. +A pure function is a function that _always_ returns the same result, if the same arguments are passed. + +The `sum` function always returns the same result. If we pass `1` and `2`, it will _always_ return `3` without side effects. If we pass `5` and `10`, it will _always_ return `15`, and so on. This is the definition of a pure function. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const person = { - name: "Lydia", - age: 21, +const add = () => { + const cache = {}; + return (num) => { + if (num in cache) { + return `From cache! ${cache[num]}`; + } else { + const result = num + 10; + cache[num] = result; + return `Calculated! ${result}`; + } + }; }; -for (const [x, y] of Object.entries(person)) { - console.log(x, y); -} +const addFunction = add(); +console.log(addFunction(10)); +console.log(addFunction(10)); +console.log(addFunction(5 * 2)); ``` -- A: `name` `Lydia` and `age` `21` -- B: `["name", "Lydia"]` and `["age", 21]` -- C: `["name", "age"]` and `undefined` -- D: `Error` +- A: `Calculated! 20` `Calculated! 20` `Calculated! 20` +- B: `Calculated! 20` `From cache! 20` `Calculated! 20` +- C: `Calculated! 20` `From cache! 20` `From cache! 20` +- D: `Calculated! 20` `From cache! 20` `Error` -**Answer: A** +**Answer: C** -`Object.entries(person)` returns an array of nested arrays, containing the keys and objects: +The `add` function is a _memoized_ function. With memoization, we can cache the results of a function in order to speed up its execution. In this case, we create a `cache` object that stores the previously returned values. -`[ [ 'name', 'Lydia' ], [ 'age', 21 ] ]` +If we call the `addFunction` function again with the same argument, it first checks whether it has already gotten that value in its cache. If that's the case, the caches value will be returned, which saves on execution time. Else, if it's not cached, it will calculate the value and store it afterwards. -Using the `for-of` loop, we can iterate over each element in the array, the subarrays in this case. We can destructure the subarrays instantly in the for-of loop, using `const [x, y]`. `x` is equal to the first element in the subarray, `y` is equal to the second element in the subarray. +We call the `addFunction` function three times with the same value: on the first invocation, the value of the function when `num` is equal to `10` isn't cached yet. The condition of the if-statement `num in cache` returns `false`, and the else block gets executed: `Calculated! 20` gets logged, and the value of the result gets added to the cache object. `cache` now looks like `{ 10: 20 }`. -The first subarray is `[ "name", "Lydia" ]`, with `x` equal to `"name"`, and `y` equal to `"Lydia"`, which get logged. -The second subarray is `[ "age", 21 ]`, with `x` equal to `"age"`, and `y` equal to `21`, which get logged. +The second time, the `cache` object contains the value that gets returned for `10`. The condition of the if-statement `num in cache` returns `true`, and `'From cache! 20'` gets logged. + +The third time, we pass `5 * 2` to the function which gets evaluated to `10`. The `cache` object contains the value that gets returned for `10`. The condition of the if-statement `num in cache` returns `true`, and `'From cache! 20'` gets logged. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -function getItems(fruitList, ...args, favoriteFruit) { - return [...fruitList, ...args, favoriteFruit] +const myLifeSummedUp = ["☕", "💻", "🍷", "🍫"]; + +for (let item in myLifeSummedUp) { + console.log(item); } -getItems(["banana", "apple"], "pear", "orange") +for (let item of myLifeSummedUp) { + console.log(item); +} ``` -- A: `["banana", "apple", "pear", "orange"]` -- B: `[["banana", "apple"], "pear", "orange"]` -- C: `["banana", "apple", ["pear"], "orange"]` -- D: `SyntaxError` +- A: `0` `1` `2` `3` and `"☕"` ` "💻"` `"🍷"` `"🍫"` +- B: `"☕"` ` "💻"` `"🍷"` `"🍫"` and `"☕"` ` "💻"` `"🍷"` `"🍫"` +- C: `"☕"` ` "💻"` `"🍷"` `"🍫"` and `0` `1` `2` `3` +- D: `0` `1` `2` `3` and `{0: "☕", 1: "💻", 2: "🍷", 3: "🍫"}` + +**Answer: A** + +With a _for-in_ loop, we can iterate over **enumerable** properties. In an array, the enumerable properties are the "keys" of array elements, which are actually their indexes. You could see an array as: + +`{0: "☕", 1: "💻", 2: "🍷", 3: "🍫"}` + +Where the keys are the enumerable properties. `0` `1` `2` `3` get logged. + +With a _for-of_ loop, we can iterate over **iterables**. An array is an iterable. When we iterate over the array, the variable "item" is equal to the element it's currently iterating over, `"☕"` ` "💻"` `"🍷"` `"🍫"` get logged. -**Answer: D** + -`...args` is a rest parameter. The rest parameter's value is an array containing all remaining arguments, **and can only be the last parameter**! In this example, the rest parameter was the second parameter. This is not possible, and will throw a syntax error. +## Q. What is the output? ```javascript -function getItems(fruitList, favoriteFruit, ...args) { - return [...fruitList, ...args, favoriteFruit]; -} - -getItems(["banana", "apple"], "pear", "orange"); +const list = [1 + 2, 1 * 2, 1 / 2]; +console.log(list); ``` -The above example works. This returns the array `[ 'banana', 'apple', 'orange', 'pear' ]` +- A: `["1 + 2", "1 * 2", "1 / 2"]` +- B: `["12", 2, 0.5]` +- C: `[3, 2, 0.5]` +- D: `[1, 1, 1]` + +**Answer: C** + +Array elements can hold any value. Numbers, strings, objects, other arrays, null, boolean values, undefined, and other expressions such as dates, functions, and calculations. + +The element will be equal to the returned value. `1 + 2` returns `3`, `1 * 2` returns `2`, and `1 / 2` returns `0.5`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -function nums(a, b) { - if (a > b) console.log("a is bigger"); - else console.log("b is bigger"); - return; - a + b; +function sayHi(name) { + return `Hi there, ${name}`; } -console.log(nums(4, 2)); -console.log(nums(1, 2)); +console.log(sayHi()); ``` -- A: `a is bigger`, `6` and `b is bigger`, `3` -- B: `a is bigger`, `undefined` and `b is bigger`, `undefined` -- C: `undefined` and `undefined` -- D: `SyntaxError` +- A: `Hi there, ` +- B: `Hi there, undefined` +- C: `Hi there, null` +- D: `ReferenceError` **Answer: B** -In JavaScript, we don't _have_ to write the semicolon (`;`) explicitly, however the JavaScript engine still adds them after statements. This is called **Automatic Semicolon Insertion**. A statement can for example be variables, or keywords like `throw`, `return`, `break`, etc. +By default, arguments have the value of `undefined`, unless a value has been passed to the function. In this case, we didn't pass a value for the `name` argument. `name` is equal to `undefined` which gets logged. -Here, we wrote a `return` statement, and another value `a + b` on a _new line_. However, since it's a new line, the engine doesn't know that it's actually the value that we wanted to return. Instead, it automatically added a semicolon after `return`. You could see this as: +In ES6, we can overwrite this default `undefined` value with default parameters. For example: -```javascript -return; -a + b; -``` +`function sayHi(name = "Lydia") { ... }` -This means that `a + b` is never reached, since a function stops running after the `return` keyword. If no value gets returned, like here, the function returns `undefined`. Note that there is no automatic insertion after `if/else` statements! +In this case, if we didn't pass a value or if we passed `undefined`, `name` would always be equal to the string `Lydia` -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -class Person { - constructor() { - this.name = "Lydia"; - } -} +var status = "😎"; -Person = class AnotherPerson { - constructor() { - this.name = "Sarah"; - } -}; +setTimeout(() => { + const status = "😍"; -const member = new Person(); -console.log(member.name); + const data = { + status: "🥑", + getStatus() { + return this.status; + }, + }; + + console.log(data.getStatus()); + console.log(data.getStatus.call(this)); +}, 0); ``` -- A: `"Lydia"` -- B: `"Sarah"` -- C: `Error: cannot redeclare Person` -- D: `SyntaxError` +- A: `"🥑"` and `"😍"` +- B: `"🥑"` and `"😎"` +- C: `"😍"` and `"😎"` +- D: `"😎"` and `"😎"` **Answer: B** -We can set classes equal to other classes/function constructors. In this case, we set `Person` equal to `AnotherPerson`. The name on this constructor is `Sarah`, so the name property on the new `Person` instance `member` is `"Sarah"`. +The value of the `this` keyword is dependent on where you use it. In a **method**, like the `getStatus` method, the `this` keyword refers to _the object that the method belongs to_. The method belongs to the `data` object, so `this` refers to the `data` object. When we log `this.status`, the `status` property on the `data` object gets logged, which is `"🥑"`. + +With the `call` method, we can change the object to which the `this` keyword refers. In **functions**, the `this` keyword refers to the _the object that the function belongs to_. We declared the `setTimeout` function on the _global object_, so within the `setTimeout` function, the `this` keyword refers to the _global object_. On the global object, there is a variable called _status_ with the value of `"😎"`. When logging `this.status`, `"😎"` gets logged. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const info = { - [Symbol("a")]: "b", +const person = { + name: "Lydia", + age: 21, }; -console.log(info); -console.log(Object.keys(info)); +let city = person.city; +city = "Amsterdam"; + +console.log(person); ``` -- A: `{Symbol('a'): 'b'}` and `["{Symbol('a')"]` -- B: `{}` and `[]` -- C: `{ a: "b" }` and `["a"]` -- D: `{Symbol('a'): 'b'}` and `[]` +- A: `{ name: "Lydia", age: 21 }` +- B: `{ name: "Lydia", age: 21, city: "Amsterdam" }` +- C: `{ name: "Lydia", age: 21, city: undefined }` +- D: `"Amsterdam"` -**Answer: D** +**Answer: A** -A Symbol is not _enumerable_. The Object.keys method returns all _enumerable_ key properties on an object. The Symbol won't be visible, and an empty array is returned. When logging the entire object, all properties will be visible, even non-enumerable ones. +We set the variable `city` equal to the value of the property called `city` on the `person` object. There is no property on this object called `city`, so the variable `city` has the value of `undefined`. -This is one of the many qualities of a symbol: besides representing an entirely unique value (which prevents accidental name collision on objects, for example when working with 2 libraries that want to add properties to the same object), you can also "hide" properties on objects this way (although not entirely. You can still access symbols using the `Object.getOwnPropertySymbols()` method). +Note that we are _not_ referencing the `person` object itself! We simply set the variable `city` equal to the current value of the `city` property on the `person` object. + +Then, we set `city` equal to the string `"Amsterdam"`. This doesn't change the person object: there is no reference to that object. + +When logging the `person` object, the unmodified object gets returned. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const getList = ([x, ...y]) => [x, y] -const getUser = user => { name: user.name, age: user.age } +function checkAge(age) { + if (age < 18) { + const message = "Sorry, you're too young."; + } else { + const message = "Yay! You're old enough!"; + } -const list = [1, 2, 3, 4] -const user = { name: "Lydia", age: 21 } + return message; +} -console.log(getList(list)) -console.log(getUser(user)) +console.log(checkAge(21)); ``` -- A: `[1, [2, 3, 4]]` and `undefined` -- B: `[1, [2, 3, 4]]` and `{ name: "Lydia", age: 21 }` -- C: `[1, 2, 3, 4]` and `{ name: "Lydia", age: 21 }` -- D: `Error` and `{ name: "Lydia", age: 21 }` +- A: `"Sorry, you're too young."` +- B: `"Yay! You're old enough!"` +- C: `ReferenceError` +- D: `undefined` -**Answer: A** +**Answer: C** -The `getList` function receives an array as its argument. Between the parentheses of the `getList` function, we destructure this array right away. You could see this as: +Variables with the `const` and `let` keyword are _block-scoped_. A block is anything between curly brackets (`{ }`). In this case, the curly brackets of the if/else statements. You cannot reference a variable outside of the block it's declared in, a ReferenceError gets thrown. -`[x, ...y] = [1, 2, 3, 4]` + -With the rest parameter `...y`, we put all "remaining" arguments in an array. The remaining arguments are `2`, `3` and `4` in this case. The value of `y` is an array, containing all the rest parameters. The value of `x` is equal to `1` in this case, so when we log `[x, y]`, `[1, [2, 3, 4]]` gets logged. +## Q. What kind of information would get logged? -The `getUser` function receives an object. With arrow functions, we don't _have_ to write curly brackets if we just return one value. However, if you want to return an _object_ from an arrow function, you have to write it between parentheses, otherwise no value gets returned! The following function would have returned an object: +```javascript +fetch("https://www.website.com/api/user/1") + .then((res) => res.json()) + .then((res) => console.log(res)); +``` -`const getUser = user => ({ name: user.name, age: user.age })` +- A: The result of the `fetch` method. +- B: The result of the second invocation of the `fetch` method. +- C: The result of the callback in the previous `.then()`. +- D: It would always be undefined. -Since no value gets returned in this case, the function returns `undefined`. +**Answer: C** + +The value of `res` in the second `.then` is equal to the returned value of the previous `.then`. You can keep chaining `.then`s like this, where the value is passed to the next handler. -## Q. ***What is the output?*** +## Q. Which option is a way to set `hasName` equal to `true`, provided you cannot pass `true` as an argument? ```javascript -const name = "Lydia"; - -console.log(name()); +function getName(name) { + const hasName = // +} ``` -- A: `SyntaxError` -- B: `ReferenceError` -- C: `TypeError` -- D: `undefined` +- A: `!!name` +- B: `name` +- C: `new Boolean(name)` +- D: `name.length` -**Answer: C** +**Answer: A** -The variable `name` holds the value of a string, which is not a function, thus cannot invoke. +With `!!name`, we determine whether the value of `name` is truthy or falsy. If name is truthy, which we want to test for, `!name` returns `false`. `!false` (which is what `!!name` practically is) returns `true`. -TypeErrors get thrown when a value is not of the expected type. JavaScript expected `name` to be a function since we're trying to invoke it. It was a string however, so a TypeError gets thrown: name is not a function! +By setting `hasName` equal to `name`, you set `hasName` equal to whatever value you passed to the `getName` function, not the boolean value `true`. -SyntaxErrors get thrown when you've written something that isn't valid JavaScript, for example when you've written the word `return` as `retrun`. -ReferenceErrors get thrown when JavaScript isn't able to find a reference to a value that you're trying to access. +`new Boolean(true)` returns an object wrapper, not the boolean value itself. + +`name.length` returns the length of the passed argument, not whether it's `true`. -## Q. ***What is the value of output?*** +## Q. What is the output? ```javascript -// 🎉✨ This is my 100th question! ✨🎉 - -const output = `${[] && "Im"}possible! -You should${"" && `n't`} see a therapist after so much JavaScript lol`; +console.log("I want pizza"[0]); ``` -- A: `possible! You should see a therapist after so much JavaScript lol` -- B: `Impossible! You should see a therapist after so much JavaScript lol` -- C: `possible! You shouldn't see a therapist after so much JavaScript lol` -- D: `Impossible! You shouldn't see a therapist after so much JavaScript lol` +- A: `"""` +- B: `"I"` +- C: `SyntaxError` +- D: `undefined` **Answer: B** -`[]` is a truthy value. With the `&&` operator, the right-hand value will be returned if the left-hand value is a truthy value. In this case, the left-hand value `[]` is a truthy value, so `"Im'` gets returned. +In order to get an character on a specific index in a string, you can use bracket notation. The first character in the string has index 0, and so on. In this case we want to get the element which index is 0, the character `"I'`, which gets logged. -`""` is a falsy value. If the left-hand value is falsy, nothing gets returned. `n't` doesn't get returned. +Note that this method is not supported in IE7 and below. In that case, use `.charAt()` -## Q. ***What is the value of output?*** +## Q. What is the output? ```javascript -const one = false || {} || null; -const two = null || false || ""; -const three = [] || 0 || true; +function sum(num1, num2 = num1) { + console.log(num1 + num2); +} -console.log(one, two, three); +sum(10); ``` -- A: `false` `null` `[]` -- B: `null` `""` `true` -- C: `{}` `""` `[]` -- D: `null` `null` `true` - -**Answer: C** - -With the `||` operator, we can return the first truthy operand. If all values are falsy, the last operand gets returned. +- A: `NaN` +- B: `20` +- C: `ReferenceError` +- D: `undefined` -`(false || {} || null)`: the empty object `{}` is a truthy value. This is the first (and only) truthy value, which gets returned. `one` is equal to `{}`. +**Answer: B** -`(null || false || "")`: all operands are falsy values. This means that the past operand, `""` gets returned. `two` is equal to `""`. +You can set a default parameter's value equal to another parameter of the function, as long as they've been defined _before_ the default parameter. We pass the value `10` to the `sum` function. If the `sum` function only receives 1 argument, it means that the value for `num2` is not passed, and the value of `num1` is equal to the passed value `10` in this case. The default value of `num2` is the value of `num1`, which is `10`. `num1 + num2` returns `20`. -`([] || 0 || "")`: the empty array`[]` is a truthy value. This is the first truthy value, which gets returned. `three` is equal to `[]`. +If you're trying to set a default parameter's value equal to a parameter which is defined _after_ (to the right), the parameter's value hasn't been initialized yet, which will throw an error. -## Q. ***What is the value of output?*** +## Q. What is the output? ```javascript -const myPromise = () => Promise.resolve("I have resolved!"); - -function firstFunction() { - myPromise().then((res) => console.log(res)); - console.log("second"); -} - -async function secondFunction() { - console.log(await myPromise()); - console.log("second"); -} - -firstFunction(); -secondFunction(); -``` - -- A: `I have resolved!`, `second` and `I have resolved!`, `second` -- B: `second`, `I have resolved!` and `second`, `I have resolved!` -- C: `I have resolved!`, `second` and `second`, `I have resolved!` -- D: `second`, `I have resolved!` and `I have resolved!`, `second` +// module.js +export default () => "Hello world"; +export const name = "Lydia"; -**Answer: D** +// index.js +import * as data from "./module"; -With a promise, we basically say _I want to execute this function, but I'll put it aside for now while it's running since this might take a while. Only when a certain value is resolved (or rejected), and when the call stack is empty, I want to use this value._ +console.log(data); +``` -We can get this value with both `.then` and the `await` keyword in an `async` function. Although we can get a promise's value with both `.then` and `await`, they work a bit differently. +- A: `{ default: function default(), name: "Lydia" }` +- B: `{ default: function default() }` +- C: `{ default: "Hello world", name: "Lydia" }` +- D: Global object of `module.js` -In the `firstFunction`, we (sort of) put the myPromise function aside while it was running, but continued running the other code, which is `console.log('second')` in this case. Then, the function resolved with the string `I have resolved`, which then got logged after it saw that the callstack was empty. +**Answer: A** -With the await keyword in `secondFunction`, we literally pause the execution of an async function until the value has been resolved befoer moving to the next line. +With the `import * as name` syntax, we import _all exports_ from the `module.js` file into the `index.js` file as a new object called `data` is created. In the `module.js` file, there are two exports: the default export, and a named export. The default export is a function which returns the string `"Hello World"`, and the named export is a variable called `name` which has the value of the string `"Lydia"`. -This means that it waited for the `myPromise` to resolve with the value `I have resolved`, and only once that happened, we moved to the next line: `second` got logged. +The `data` object has a `default` property for the default export, other properties have the names of the named exports and their corresponding values. -## Q. ***What is the value of output?*** +## Q. What is the output? ```javascript -const set = new Set(); - -set.add(1); -set.add("Lydia"); -set.add({ name: "Lydia" }); - -for (let item of set) { - console.log(item + 2); +class Person { + constructor(name) { + this.name = name; + } } + +const member = new Person("John"); +console.log(typeof member); ``` -- A: `3`, `NaN`, `NaN` -- B: `3`, `7`, `NaN` -- C: `3`, `Lydia2`, `[Object object]2` -- D: `"12"`, `Lydia2`, `[Object object]2` +- A: `"class"` +- B: `"function"` +- C: `"object"` +- D: `"string"` **Answer: C** -The `+` operator is not only used for adding numerical values, but we can also use it to concatenate strings. Whenever the JavaScript engine sees that one or more values are not a number, it coerces the number into a string. - -The first one is `1`, which is a numerical value. `1 + 2` returns the number 3. +Classes are syntactical sugar for function constructors. The equivalent of the `Person` class as a function constructor would be: -However, the second one is a string `"Lydia"`. `"Lydia"` is a string and `2` is a number: `2` gets coerced into a string. `"Lydia"` and `"2"` get concatenated, which results in the string `"Lydia2"`. +```javascript +function Person() { + this.name = name; +} +``` -`{ name: "Lydia" }` is an object. Neither a number nor an object is a string, so it stringifies both. Whenever we stringify a regular object, it becomes `"[Object object]"`. `"[Object object]"` concatenated with `"2"` becomes `"[Object object]2"`. +Calling a function constructor with `new` results in the creation of an instance of `Person`, `typeof` keyword returns `"object"` for an instance. `typeof member` returns `"object"`. -## Q. ***What is its value?*** +## Q. What is the output? ```javascript -Promise.resolve(5); +let newList = [1, 2, 3].push(4); + +console.log(newList.push(5)); ``` -- A: `5` -- B: `Promise {: 5}` -- C: `Promise {: 5}` +- A: `[1, 2, 3, 4, 5]` +- B: `[1, 2, 3, 5]` +- C: `[1, 2, 3, 4]` - D: `Error` -**Answer: C** +**Answer: D** -We can pass any type of value we want to `Promise.resolve`, either a promise or a non-promise. The method itself returns a promise with the resolved value. If you pass a regular function, it'll be a resolved promise with a regular value. If you pass a promise, it'll be a resolved promise with the resolved value of that passed promise. +The `.push` method returns the _new length_ of the array, not the array itself! By setting `newList` equal to `[1, 2, 3].push(4)`, we set `newList` equal to the new length of the array: `4`. -In this case, we just passed the numerical value `5`. It returns a resolved promise with the value `5`. +Then, we try to use the `.push` method on `newList`. Since `newList` is the numerical value `4`, we cannot use the `.push` method: a TypeError is thrown. -## Q. ***What is its value?*** +## Q. What is the output? ```javascript -function compareMembers(person1, person2 = person) { - if (person1 !== person2) { - console.log("Not the same!"); - } else { - console.log("They are the same!"); - } +function giveLydiaPizza() { + return "Here is pizza!"; } -const person = { name: "Lydia" }; +const giveLydiaChocolate = () => + "Here's chocolate... now go hit the gym already."; -compareMembers(person); +console.log(giveLydiaPizza.prototype); +console.log(giveLydiaChocolate.prototype); ``` -- A: `Not the same!` -- B: `They are the same!` -- C: `ReferenceError` -- D: `SyntaxError` - -**Answer: B** - -Objects are passed by reference. When we check objects for strict equality (`===`), we're comparing their references. - -We set the default value for `person2` equal to the `person` object, and passed the `person` object as the value for `person1`. +- A: `{ constructor: ...}` `{ constructor: ...}` +- B: `{}` `{ constructor: ...}` +- C: `{ constructor: ...}` `{}` +- D: `{ constructor: ...}` `undefined` -This means that both values have a reference to the same spot in memory, thus they are equal. +**Answer: D** -The code block in the `else` statement gets run, and `They are the same!` gets logged. +Regular functions, such as the `giveLydiaPizza` function, have a `prototype` property, which is an object (prototype object) with a `constructor` property. Arrow functions however, such as the `giveLydiaChocolate` function, do not have this `prototype` property. `undefined` gets returned when trying to access the `prototype` property using `giveLydiaChocolate.prototype`. -## Q. ***What is its value?*** +## Q. What is the output? ```javascript -const colorConfig = { - red: true, - blue: false, - green: true, - black: true, - yellow: false, +const person = { + name: "Lydia", + age: 21, }; -const colors = ["pink", "red", "blue"]; - -console.log(colorConfig.colors[1]); +for (const [x, y] of Object.entries(person)) { + console.log(x, y); +} ``` -- A: `true` -- B: `false` -- C: `undefined` -- D: `TypeError` +- A: `name` `Lydia` and `age` `21` +- B: `["name", "Lydia"]` and `["age", 21]` +- C: `["name", "age"]` and `undefined` +- D: `Error` -**Answer: D** +**Answer: A** -In JavaScript, we have two ways to access properties on an object: bracket notation, or dot notation. In this example, we use dot notation (`colorConfig.colors`) instead of bracket notation (`colorConfig["colors"]`). +`Object.entries(person)` returns an array of nested arrays, containing the keys and objects: -With dot notation, JavaScript tries to find the property on the object with that exact name. In this example, JavaScript tries to find a property called `colors` on the `colorConfig` object. There is no proprety called `colors`, so this returns `undefined`. Then, we try to access the value of the first element by using `[1]`. We cannot do this on a value that's `undefined`, so it throws a `TypeError`: `Cannot read property '1' of undefined`. +`[ [ 'name', 'Lydia' ], [ 'age', 21 ] ]` -JavaScript interprets (or unboxes) statements. When we use bracket notation, it sees the first opening bracket `[` and keeps going until it finds the closing bracket `]`. Only then, it will evaluate the statement. If we would've used `colorConfig[colors[1]]`, it would have returned the value of the `red` property on the `colorConfig` object. +Using the `for-of` loop, we can iterate over each element in the array, the subarrays in this case. We can destructure the subarrays instantly in the for-of loop, using `const [x, y]`. `x` is equal to the first element in the subarray, `y` is equal to the second element in the subarray. + +The first subarray is `[ "name", "Lydia" ]`, with `x` equal to `"name"`, and `y` equal to `"Lydia"`, which get logged. +The second subarray is `[ "age", 21 ]`, with `x` equal to `"age"`, and `y` equal to `21`, which get logged. -## Q. ***What is its value?*** +## Q. What is the output? ```javascript -console.log("❤️" === "❤️"); +function getItems(fruitList, ...args, favoriteFruit) { + return [...fruitList, ...args, favoriteFruit] +} + +getItems(["banana", "apple"], "pear", "orange") ``` -- A: `true` -- B: `false` +- A: `["banana", "apple", "pear", "orange"]` +- B: `[["banana", "apple"], "pear", "orange"]` +- C: `["banana", "apple", ["pear"], "orange"]` +- D: `SyntaxError` -**Answer: A** +**Answer: D** -Under the hood, emojis are unicodes. The unicodes for the heart emoji is `"U+2764 U+FE0F"`. These are always the same for the same emojis, so we're comparing two equal strings to each other, which returns true. +`...args` is a rest parameter. The rest parameter's value is an array containing all remaining arguments, **and can only be the last parameter**! In this example, the rest parameter was the second parameter. This is not possible, and will throw a syntax error. + +```javascript +function getItems(fruitList, favoriteFruit, ...args) { + return [...fruitList, ...args, favoriteFruit]; +} + +getItems(["banana", "apple"], "pear", "orange"); +``` + +The above example works. This returns the array `[ 'banana', 'apple', 'orange', 'pear' ]` -## Q. ***Which of these methods modifies the original array?*** +## Q. What is the output? ```javascript -const emojis = ["✨", "🥑", "😍"]; +function nums(a, b) { + if (a > b) console.log("a is bigger"); + else console.log("b is bigger"); + return; + a + b; +} -emojis.map((x) => x + "✨"); -emojis.filter((x) => x !== "🥑"); -emojis.find((x) => x !== "🥑"); -emojis.reduce((acc, cur) => acc + "✨"); -emojis.slice(1, 2, "✨"); -emojis.splice(1, 2, "✨"); +console.log(nums(4, 2)); +console.log(nums(1, 2)); ``` -- A: `All of them` -- B: `map` `reduce` `slice` `splice` -- C: `map` `slice` `splice` -- D: `splice` +- A: `a is bigger`, `6` and `b is bigger`, `3` +- B: `a is bigger`, `undefined` and `b is bigger`, `undefined` +- C: `undefined` and `undefined` +- D: `SyntaxError` -**Answer: D** +**Answer: B** -With `splice` method, we modify the original array by deleting, replacing or adding elements. In this case, we removed 2 items from index 1 (we removed `'🥑'` and `'😍'`) and added the ✨ emoji instead. +In JavaScript, we don't _have_ to write the semicolon (`;`) explicitly, however the JavaScript engine still adds them after statements. This is called **Automatic Semicolon Insertion**. A statement can for example be variables, or keywords like `throw`, `return`, `break`, etc. -`map`, `filter` and `slice` return a new array, `find` returns an element, and `reduce` returns a reduced value. +Here, we wrote a `return` statement, and another value `a + b` on a _new line_. However, since it's a new line, the engine doesn't know that it's actually the value that we wanted to return. Instead, it automatically added a semicolon after `return`. You could see this as: + +```javascript +return; +a + b; +``` + +This means that `a + b` is never reached, since a function stops running after the `return` keyword. If no value gets returned, like here, the function returns `undefined`. Note that there is no automatic insertion after `if/else` statements! -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -const food = ["🍕", "🍫", "🥑", "🍔"]; -const info = { favoriteFood: food[0] }; +class Person { + constructor() { + this.name = "Lydia"; + } +} -info.favoriteFood = "🍝"; +Person = class AnotherPerson { + constructor() { + this.name = "Sarah"; + } +}; -console.log(food); +const member = new Person(); +console.log(member.name); ``` -- A: `['🍕', '🍫', '🥑', '🍔']` -- B: `['🍝', '🍫', '🥑', '🍔']` -- C: `['🍝', '🍕', '🍫', '🥑', '🍔']` -- D: `ReferenceError` - -**Answer: A** - -We set the value of the `favoriteFood` property on the `info` object equal to the string with the pizza emoji, `'🍕'`. A string is a primitive data type. In JavaScript, primitive data types act by reference +- A: `"Lydia"` +- B: `"Sarah"` +- C: `Error: cannot redeclare Person` +- D: `SyntaxError` -In JavaScript, primitive data types (everything that's not an object) interact by _value_. In this case, we set the value of the `favoriteFood` property on the `info` object equal to the value of the first element in the `food` array, the string with the pizza emoji in this case (`'🍕'`). A string is a primitive data type, and interact by value (see my [blogpost](https://www.theavocoder.com/complete-javascript/2018/12/21/by-value-vs-by-reference) if you're interested in learning more) +**Answer: B** -Then, we change the value of the `favoriteFood` property on the `info` object. The `food` array hasn't changed, since the value of `favoriteFood` was merely a _copy_ of the value of the first element in the array, and doesn't have a reference to the same spot in memory as the element on `food[0]`. When we log food, it's still the original array, `['🍕', '🍫', '🥑', '🍔']`. +We can set classes equal to other classes/function constructors. In this case, we set `Person` equal to `AnotherPerson`. The name on this constructor is `Sarah`, so the name property on the new `Person` instance `member` is `"Sarah"`. -## Q. ***What does this method do?*** +## Q. What is the output? ```javascript -JSON.parse(); -``` - -- A: Parses JSON to a JavaScript value -- B: Parses a JavaScript object to JSON -- C: Parses any JavaScript value to JSON -- D: Parses JSON to a JavaScript object only +const info = { + [Symbol("a")]: "b", +}; -**Answer: A** +console.log(info); +console.log(Object.keys(info)); +``` -With the `JSON.parse()` method, we can parse JSON string to a JavaScript value. +- A: `{Symbol('a'): 'b'}` and `["{Symbol('a')"]` +- B: `{}` and `[]` +- C: `{ a: "b" }` and `["a"]` +- D: `{Symbol('a'): 'b'}` and `[]` -```javascript -// Stringifying a number into valid JSON, then parsing the JSON string to a JavaScript value: -const jsonNumber = JSON.stringify(4); // '4' -JSON.parse(jsonNumber); // 4 +**Answer: D** -// Stringifying an array value into valid JSON, then parsing the JSON string to a JavaScript value: -const jsonArray = JSON.stringify([1, 2, 3]); // '[1, 2, 3]' -JSON.parse(jsonArray); // [1, 2, 3] +A Symbol is not _enumerable_. The Object.keys method returns all _enumerable_ key properties on an object. The Symbol won't be visible, and an empty array is returned. When logging the entire object, all properties will be visible, even non-enumerable ones. -// Stringifying an object into valid JSON, then parsing the JSON string to a JavaScript value: -const jsonArray = JSON.stringify({ name: "Lydia" }); // '{"name":"Lydia"}' -JSON.parse(jsonArray); // { name: 'Lydia' } -``` +This is one of the many qualities of a symbol: besides representing an entirely unique value (which prevents accidental name collision on objects, for example when working with 2 libraries that want to add properties to the same object), you can also "hide" properties on objects this way (although not entirely. You can still access symbols using the `Object.getOwnPropertySymbols()` method). -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -let name = "Lydia"; +const getList = ([x, ...y]) => [x, y] +const getUser = user => { name: user.name, age: user.age } -function getName() { - console.log(name); - let name = "Sarah"; -} +const list = [1, 2, 3, 4] +const user = { name: "Lydia", age: 21 } -getName(); +console.log(getList(list)) +console.log(getUser(user)) ``` -- A: Lydia -- B: Sarah -- C: `undefined` -- D: `ReferenceError` +- A: `[1, [2, 3, 4]]` and `undefined` +- B: `[1, [2, 3, 4]]` and `{ name: "Lydia", age: 21 }` +- C: `[1, 2, 3, 4]` and `{ name: "Lydia", age: 21 }` +- D: `Error` and `{ name: "Lydia", age: 21 }` -**Answer: D** +**Answer: A** -Each function has its own _execution context_ (or _scope_). The `getName` function first looks within its own context (scope) to see if it contains the variable `name` we're trying to access. In this case, the `getName` function contains its own `name` variable: we declare the variable `name` with the `let` keyword, and with the value of `'Sarah'`. +The `getList` function receives an array as its argument. Between the parentheses of the `getList` function, we destructure this array right away. You could see this as: -Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don't get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`. +`[x, ...y] = [1, 2, 3, 4]` -If we wouldn't have declared the `name` variable within the `getName` function, the javascript engine would've looked down the _scope chain_. The outer scope has a variable called `name` with the value of `Lydia`. In that case, it would've logged `Lydia`. +With the rest parameter `...y`, we put all "remaining" arguments in an array. The remaining arguments are `2`, `3` and `4` in this case. The value of `y` is an array, containing all the rest parameters. The value of `x` is equal to `1` in this case, so when we log `[x, y]`, `[1, [2, 3, 4]]` gets logged. -```javascript -let name = "Lydia"; +The `getUser` function receives an object. With arrow functions, we don't _have_ to write curly brackets if we just return one value. However, if you want to return an _object_ from an arrow function, you have to write it between parentheses, otherwise no value gets returned! The following function would have returned an object: -function getName() { - console.log(name); -} +`const getUser = user => ({ name: user.name, age: user.age })` -getName(); // Lydia -``` +Since no value gets returned in this case, the function returns `undefined`. -## Q. ***What is the output?*** +## Q. What is the output? ```javascript -function* generatorOne() { - yield ["a", "b", "c"]; -} - -function* generatorTwo() { - yield* ["a", "b", "c"]; -} - -const one = generatorOne(); -const two = generatorTwo(); +const name = "Lydia"; -console.log(one.next().value); -console.log(two.next().value); +console.log(name()); ``` -- A: `a` and `a` -- B: `a` and `undefined` -- C: `['a', 'b', 'c']` and `a` -- D: `a` and `['a', 'b', 'c']` +- A: `SyntaxError` +- B: `ReferenceError` +- C: `TypeError` +- D: `undefined` **Answer: C** -With the `yield` keyword, we `yield` values in a generator function. With the `yield*` keyword, we can yield values from another generator function, or iterable object (for example an array). - -In `generatorOne`, we yield the entire array `['a', 'b', 'c']` using the `yield` keyword. The value of `value` property on the object returned by the `next` method on `one` (`one.next().value`) is equal to the entire array `['a', 'b', 'c']`. - -```javascript -console.log(one.next().value); // ['a', 'b', 'c'] -console.log(one.next().value); // undefined -``` +The variable `name` holds the value of a string, which is not a function, thus cannot invoke. -In `generatorTwo`, we use the `yield*` keyword. This means that the first yielded value of `two`, is equal to the first yielded value in the iterator. The iterator is the array `['a', 'b', 'c']`. The first yielded value is `a`, so the first time we call `two.next().value`, `a` is returned. +TypeErrors get thrown when a value is not of the expected type. JavaScript expected `name` to be a function since we're trying to invoke it. It was a string however, so a TypeError gets thrown: name is not a function! -```javascript -console.log(two.next().value); // 'a' -console.log(two.next().value); // 'b' -console.log(two.next().value); // 'c' -console.log(two.next().value); // undefined -``` +SyntaxErrors get thrown when you've written something that isn't valid JavaScript, for example when you've written the word `return` as `retrun`. +ReferenceErrors get thrown when JavaScript isn't able to find a reference to a value that you're trying to access. -## Q. ***What is the output?*** +## Q. What is the value of output? ```javascript -console.log(`${((x) => x)("I love")} to program`); +// 🎉✨ This is my 100th question! ✨🎉 + +const output = `${[] && "Im"}possible! +You should${"" && `n't`} see a therapist after so much JavaScript lol`; ``` -- A: `I love to program` -- B: `undefined to program` -- C: `${(x => x)('I love') to program` -- D: `TypeError` +- A: `possible! You should see a therapist after so much JavaScript lol` +- B: `Impossible! You should see a therapist after so much JavaScript lol` +- C: `possible! You shouldn't see a therapist after so much JavaScript lol` +- D: `Impossible! You shouldn't see a therapist after so much JavaScript lol` -**Answer: A** +**Answer: B** -Expressions within template literals are evaluated first. This means that the string will contain the returned value of the expression, the immediately invoked function `(x => x)('I love')` in this case. We pass the value `'I love'` as an argument to the `x => x` arrow function. `x` is equal to `'I love'`, which gets returned. This results in `I love to program`. +`[]` is a truthy value. With the `&&` operator, the right-hand value will be returned if the left-hand value is a truthy value. In this case, the left-hand value `[]` is a truthy value, so `"Im'` gets returned. + +`""` is a falsy value. If the left-hand value is falsy, nothing gets returned. `n't` doesn't get returned. -## Q. ***What will happen?*** +## Q. What is the value of output? ```javascript -let config = { - alert: setInterval(() => { - console.log("Alert!"); - }, 1000), -}; +const one = false || {} || null; +const two = null || false || ""; +const three = [] || 0 || true; -config = null; +console.log(one, two, three); ``` -- A: The `setInterval` callback won't be invoked -- B: The `setInterval` callback gets invoked once -- C: The `setInterval` callback will still be called every second -- D: We never invoked `config.alert()`, config is `null` +- A: `false` `null` `[]` +- B: `null` `""` `true` +- C: `{}` `""` `[]` +- D: `null` `null` `true` **Answer: C** -Normally when we set objects equal to `null`, those objects get _garbage collected_ as there is no reference anymore to that object. However, since the callback function within `setInterval` is an arrow function (thus bound to the `config` object), the callback function still holds a reference to the `config` object. As long as there is a reference, the object won't get garbage collected. Since it's not garbage collected, the `setInterval` callback function will still get invoked every 1000ms (1s). +With the `||` operator, we can return the first truthy operand. If all values are falsy, the last operand gets returned. + +`(false || {} || null)`: the empty object `{}` is a truthy value. This is the first (and only) truthy value, which gets returned. `one` is equal to `{}`. + +`(null || false || "")`: all operands are falsy values. This means that the past operand, `""` gets returned. `two` is equal to `""`. + +`([] || 0 || "")`: the empty array`[]` is a truthy value. This is the first truthy value, which gets returned. `three` is equal to `[]`. -## Q. ***Which method(s) will return the value `'Hello world!'`?*** +## Q. What is the value of output? ```javascript -const myMap = new Map(); -const myFunc = () => "greeting"; +const myPromise = () => Promise.resolve("I have resolved!"); -myMap.set(myFunc, "Hello world!"); +function firstFunction() { + myPromise().then((res) => console.log(res)); + console.log("second"); +} -//1 -myMap.get("greeting"); -//2 -myMap.get(myFunc); -//3 -myMap.get(() => "greeting"); +async function secondFunction() { + console.log(await myPromise()); + console.log("second"); +} + +firstFunction(); +secondFunction(); ``` -- A: 1 -- B: 2 -- C: 2 and 3 -- D: All of them +- A: `I have resolved!`, `second` and `I have resolved!`, `second` +- B: `second`, `I have resolved!` and `second`, `I have resolved!` +- C: `I have resolved!`, `second` and `second`, `I have resolved!` +- D: `second`, `I have resolved!` and `I have resolved!`, `second` -**Answer: B** +**Answer: D** -When adding a key/value pair using the `set` method, the key will be the value of the first argument passed to the `set` function, and the value will be the second argument passed to the `set` function. The key is the _function_ `() => 'greeting'` in this case, and the value `'Hello world'`. `myMap` is now `{ () => 'greeting' => 'Hello world!' }`. +With a promise, we basically say _I want to execute this function, but I'll put it aside for now while it's running since this might take a while. Only when a certain value is resolved (or rejected), and when the call stack is empty, I want to use this value._ -1 is wrong, since the key is not `'greeting'` but `() => 'greeting'`. -3 is wrong, since we're creating a new function by passing it as a parameter to the `get` method. Object interact by _reference_. Functions are objects, which is why two functions are never strictly equal, even if they are identical: they have a reference to a different spot in memory. +We can get this value with both `.then` and the `await` keyword in an `async` function. Although we can get a promise's value with both `.then` and `await`, they work a bit differently. + +In the `firstFunction`, we (sort of) put the myPromise function aside while it was running, but continued running the other code, which is `console.log('second')` in this case. Then, the function resolved with the string `I have resolved`, which then got logged after it saw that the callstack was empty. + +With the await keyword in `secondFunction`, we literally pause the execution of an async function until the value has been resolved befoer moving to the next line. + +This means that it waited for the `myPromise` to resolve with the value `I have resolved`, and only once that happened, we moved to the next line: `second` got logged. -## Q. ***What is the output?*** +## Q. What is the value of output? ```javascript -const person = { - name: "Lydia", - age: 21, -}; - -const changeAge = (x = { ...person }) => (x.age += 1); -const changeAgeAndName = (x = { ...person }) => { - x.age += 1; - x.name = "Sarah"; -}; +const set = new Set(); -changeAge(person); -changeAgeAndName(); +set.add(1); +set.add("Lydia"); +set.add({ name: "Lydia" }); -console.log(person); +for (let item of set) { + console.log(item + 2); +} ``` -- A: `{name: "Sarah", age: 22}` -- B: `{name: "Sarah", age: 23}` -- C: `{name: "Lydia", age: 22}` -- D: `{name: "Lydia", age: 23}` +- A: `3`, `NaN`, `NaN` +- B: `3`, `7`, `NaN` +- C: `3`, `Lydia2`, `[Object object]2` +- D: `"12"`, `Lydia2`, `[Object object]2` **Answer: C** -Both the `changeAge` and `changeAgeAndName` functions have a default parameter, namely a _newly_ created object `{ ...person }`. This object has copies of all the key/values in the `person` object. +The `+` operator is not only used for adding numerical values, but we can also use it to concatenate strings. Whenever the JavaScript engine sees that one or more values are not a number, it coerces the number into a string. -First, we invoke the `changeAge` function and pass the `person` object as its argument. This function increases the value of the `age` property by 1. `person` is now `{ name: "Lydia", age: 22 }`. +The first one is `1`, which is a numerical value. `1 + 2` returns the number 3. -Then, we invoke the `changeAgeAndName` function, however we don't pass a parameter. Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it's a new object, it doesn't affect the values of the properties on the `person` object. `person` is still equal to `{ name: "Lydia", age: 22 }`. +However, the second one is a string `"Lydia"`. `"Lydia"` is a string and `2` is a number: `2` gets coerced into a string. `"Lydia"` and `"2"` get concatenated, which results in the string `"Lydia2"`. + +`{ name: "Lydia" }` is an object. Neither a number nor an object is a string, so it stringifies both. Whenever we stringify a regular object, it becomes `"[Object object]"`. `"[Object object]"` concatenated with `"2"` becomes `"[Object object]2"`. -## Q. ***Predict the output*** +## Q. What is its value? -```js -if(2 == true) // returns false - -if(2 == false) // returns false +```javascript +Promise.resolve(5); ``` +- A: `5` +- B: `Promise {: 5}` +- C: `Promise {: 5}` +- D: `Error` + +**Answer: C** + +We can pass any type of value we want to `Promise.resolve`, either a promise or a non-promise. The method itself returns a promise with the resolved value. If you pass a regular function, it'll be a resolved promise with a regular value. If you pass a promise, it'll be a resolved promise with the resolved value of that passed promise. + +In this case, we just passed the numerical value `5`. It returns a resolved promise with the value `5`. + -## Q. ***Being told that an unsorted array contains (n - 1) of n consecutive numbers (where the bounds are defined), find the missing number in O(n) time?*** +## Q. What is its value? -```js -// The output of the function should be 8 -var arrayOfIntegers = [2, 5, 1, 4, 9, 6, 3, 7]; -var upperBound = 9; -var lowerBound = 1; +```javascript +function compareMembers(person1, person2 = person) { + if (person1 !== person2) { + console.log("Not the same!"); + } else { + console.log("They are the same!"); + } +} -findMissingNumber(arrayOfIntegers, upperBound, lowerBound); // 8 +const person = { name: "Lydia" }; -function findMissingNumber(arrayOfIntegers, upperBound, lowerBound) { - // Iterate through array to find the sum of the numbers - var sumOfIntegers = 0; - for (var i = 0; i < arrayOfIntegers.length; i++) { - sumOfIntegers += arrayOfIntegers[i]; - } +compareMembers(person); +``` - // Find theoretical sum of the consecutive numbers using a variation of Gauss Sum. - // Formula: [(N * (N + 1)) / 2] - [(M * (M - 1)) / 2]; - // N is the upper bound and M is the lower bound +- A: `Not the same!` +- B: `They are the same!` +- C: `ReferenceError` +- D: `SyntaxError` + +**Answer: B** - upperLimitSum = (upperBound * (upperBound + 1)) / 2; - lowerLimitSum = (lowerBound * (lowerBound - 1)) / 2; +Objects are passed by reference. When we check objects for strict equality (`===`), we're comparing their references. - theoreticalSum = upperLimitSum - lowerLimitSum; +We set the default value for `person2` equal to the `person` object, and passed the `person` object as the value for `person1`. - return theoreticalSum - sumOfIntegers; -} -``` +This means that both values have a reference to the same spot in memory, thus they are equal. + +The code block in the `else` statement gets run, and `They are the same!` gets logged. -## Q. ***How will you remove duplicates from an array in JavaScript?*** - -**a.) Using set()** -```javascript -const names = ['John', 'Paul', 'George', 'Ringo', 'John']; - -let unique = [...new Set(names)]; -console.log(unique); // 'John', 'Paul', 'George', 'Ringo' -``` -**b.) Using filter()** -```javascript -const names = ['John', 'Paul', 'George', 'Ringo', 'John']; +## Q. What is its value? -let x = (names) => names.filter((v,i) => names.indexOf(v) === i) -x(names); // 'John', 'Paul', 'George', 'Ringo' -``` -**c.) Using forEach()** ```javascript -const names = ['John', 'Paul', 'George', 'Ringo', 'John']; - -function removeDups(names) { - let unique = {}; - names.forEach(function(i) { - if(!unique[i]) { - unique[i] = true; - } - }); - return Object.keys(unique); -} - -removeDups(names); // // 'John', 'Paul', 'George', 'Ringo' -``` - -**d.) Using set()** +const colorConfig = { + red: true, + blue: false, + green: true, + black: true, + yellow: false, +}; -```js -// ES6 Implementation -var array = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; +const colors = ["pink", "red", "blue"]; -Array.from(new Set(array)); // [1, 2, 3, 5, 9, 8] +console.log(colorConfig.colors[1]); ``` -**e.) Using Hashmap** - -```js -// ES5 Implementation -var array = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; +- A: `true` +- B: `false` +- C: `undefined` +- D: `TypeError` -uniqueArray(array); // [1, 2, 3, 5, 9, 8] +**Answer: D** -function uniqueArray(array) { - var hashmap = {}; - var unique = []; +In JavaScript, we have two ways to access properties on an object: bracket notation, or dot notation. In this example, we use dot notation (`colorConfig.colors`) instead of bracket notation (`colorConfig["colors"]`). - for(var i = 0; i < array.length; i++) { - // If key returns undefined (unique), it is evaluated as false. - if(!hashmap.hasOwnProperty(array[i])) { - hashmap[array[i]] = 1; - unique.push(array[i]); - } - } +With dot notation, JavaScript tries to find the property on the object with that exact name. In this example, JavaScript tries to find a property called `colors` on the `colorConfig` object. There is no proprety called `colors`, so this returns `undefined`. Then, we try to access the value of the first element by using `[1]`. We cannot do this on a value that's `undefined`, so it throws a `TypeError`: `Cannot read property '1' of undefined`. - return unique; -} -``` +JavaScript interprets (or unboxes) statements. When we use bracket notation, it sees the first opening bracket `[` and keeps going until it finds the closing bracket `]`. Only then, it will evaluate the statement. If we would've used `colorConfig[colors[1]]`, it would have returned the value of the `red` property on the `colorConfig` object. -## Q. ***Given a string, reverse each word in the sentence*** +## Q. What is its value? -```js -var string = "Welcome to this Javascript Guide!"; +```javascript +console.log("❤️" === "❤️"); +``` -var reverseEntireSentence = reverseBySeparator(string, ""); +- A: `true` +- B: `false` -var reverseEachWord = reverseBySeparator(reverseEntireSentence, " "); +**Answer: A** -function reverseBySeparator(string, separator) { - return string.split(separator).reverse().join(separator); -} -``` +Under the hood, emojis are unicodes. The unicodes for the heart emoji is `"U+2764 U+FE0F"`. These are always the same for the same emojis, so we're comparing two equal strings to each other, which returns true. -## Q. ***Implement enqueue and dequeue using only two stacks*** +## Q. Which of these methods modifies the original array? -Enqueue means to add an element, dequeue to remove an element. +```javascript +const emojis = ["✨", "🥑", "😍"]; -```js -var inputStack = []; // First stack -var outputStack = []; // Second stack +emojis.map((x) => x + "✨"); +emojis.filter((x) => x !== "🥑"); +emojis.find((x) => x !== "🥑"); +emojis.reduce((acc, cur) => acc + "✨"); +emojis.slice(1, 2, "✨"); +emojis.splice(1, 2, "✨"); +``` -// For enqueue, just push the item into the first stack -function enqueue(stackInput, item) { - return stackInput.push(item); -} +- A: `All of them` +- B: `map` `reduce` `slice` `splice` +- C: `map` `slice` `splice` +- D: `splice` -function dequeue(stackInput, stackOutput) { - // Reverse the stack such that the first element of the output stack is the - // last element of the input stack. After that, pop the top of the output to - // get the first element that was ever pushed into the input stack - if (stackOutput.length <= 0) { - while(stackInput.length > 0) { - var elementToOutput = stackInput.pop(); - stackOutput.push(elementToOutput); - } - } +**Answer: D** - return stackOutput.pop(); -} -``` +With `splice` method, we modify the original array by deleting, replacing or adding elements. In this case, we removed 2 items from index 1 (we removed `'🥑'` and `'😍'`) and added the ✨ emoji instead. + +`map`, `filter` and `slice` return a new array, `find` returns an element, and `reduce` returns a reduced value. -## Q. ***How would you use a closure to create a private counter?*** +## Q. What is the output? -You can create a function within an outer function (a closure) that allows you to update a private variable but the variable wouldn\'t be accessible from outside the function without the use of a helper function. +```javascript +const food = ["🍕", "🍫", "🥑", "🍔"]; +const info = { favoriteFood: food[0] }; -```js -function counter() { - var _counter = 0; - // return an object with several functions that allow you - // to modify the private _counter variable - return { - add: function(increment) { _counter += increment; }, - retrieve: function() { return 'The counter is currently at: ' + _counter; } - } -} +info.favoriteFood = "🍝"; -// error if we try to access the private variable like below -// _counter; +console.log(food); +``` -// usage of our counter function -var c = counter(); -c.add(5); -c.add(9); +- A: `['🍕', '🍫', '🥑', '🍔']` +- B: `['🍝', '🍫', '🥑', '🍔']` +- C: `['🍝', '🍕', '🍫', '🥑', '🍔']` +- D: `ReferenceError` -// now we can access the private variable in the following way -c.retrieve(); // => The counter is currently at: 14 -``` +**Answer: A** + +We set the value of the `favoriteFood` property on the `info` object equal to the string with the pizza emoji, `'🍕'`. A string is a primitive data type. In JavaScript, primitive data types act by reference + +In JavaScript, primitive data types (everything that's not an object) interact by _value_. In this case, we set the value of the `favoriteFood` property on the `info` object equal to the value of the first element in the `food` array, the string with the pizza emoji in this case (`'🍕'`). A string is a primitive data type, and interact by value (see my [blogpost](https://www.theavocoder.com/complete-javascript/2018/12/21/by-value-vs-by-reference) if you're interested in learning more) + +Then, we change the value of the `favoriteFood` property on the `info` object. The `food` array hasn't changed, since the value of `favoriteFood` was merely a _copy_ of the value of the first element in the array, and doesn't have a reference to the same spot in memory as the element on `food[0]`. When we log food, it's still the original array, `['🍕', '🍫', '🥑', '🍔']`. -## Q. ***How to divide an array in multiple equal parts in JS?*** - -```js -const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; -let lenth = 3; +## Q. What does this method do? -function split(len) { - while (arr.length > 0) { - console.log(arr.splice(0, len)); - } -} -split(lenth); +```javascript +JSON.parse(); ``` -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/split-array-5od3rz)** +- A: Parses JSON to a JavaScript value +- B: Parses a JavaScript object to JSON +- C: Parses any JavaScript value to JSON +- D: Parses JSON to a JavaScript object only - +**Answer: A** -## Q. ***Write a random integers function to print integers with in a range?*** +With the `JSON.parse()` method, we can parse JSON string to a JavaScript value. -**Example:** +```javascript +// Stringifying a number into valid JSON, then parsing the JSON string to a JavaScript value: +const jsonNumber = JSON.stringify(4); // '4' +JSON.parse(jsonNumber); // 4 -```js -/** - * function to return a random number - * between min and max range - * - * */ -function randomInteger(min, max) { - return Math.floor(Math.random() * (max - min + 1) ) + min; -} -randomInteger(1, 100); // returns a random integer from 1 to 100 -``` +// Stringifying an array value into valid JSON, then parsing the JSON string to a JavaScript value: +const jsonArray = JSON.stringify([1, 2, 3]); // '[1, 2, 3]' +JSON.parse(jsonArray); // [1, 2, 3] -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-random-integers-yd1cy8?file=/src/index.js)** +// Stringifying an object into valid JSON, then parsing the JSON string to a JavaScript value: +const jsonArray = JSON.stringify({ name: "Lydia" }); // '{"name":"Lydia"}' +JSON.parse(jsonArray); // { name: 'Lydia' } +``` -## Q. ***How to convert Decimal to Binary in JavaScript?*** +## Q. What is the output? -**Example 01:** Convert Decimal to Binary +```javascript +let name = "Lydia"; -```js -function DecimalToBinary(number) { - let bin = 0; - let rem, - i = 1; - while (number !== 0) { - rem = number % 2; - number = parseInt(number / 2); - bin = bin + rem * i; - i = i * 10; - } - console.log(`Binary: ${bin}`); +function getName() { + console.log(name); + let name = "Sarah"; } -DecimalToBinary(10); +getName(); ``` -**Example 02:** Convert Decimal to Binary Using `toString()` +- A: Lydia +- B: Sarah +- C: `undefined` +- D: `ReferenceError` -```js -let val = 10; +**Answer: D** + +Each function has its own _execution context_ (or _scope_). The `getName` function first looks within its own context (scope) to see if it contains the variable `name` we're trying to access. In this case, the `getName` function contains its own `name` variable: we declare the variable `name` with the `let` keyword, and with the value of `'Sarah'`. + +Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don't get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`. + +If we wouldn't have declared the `name` variable within the `getName` function, the javascript engine would've looked down the _scope chain_. The outer scope has a variable called `name` with the value of `Lydia`. In that case, it would've logged `Lydia`. + +```javascript +let name = "Lydia"; -console.log(val.toString(2)); // 1010 ==> Binary Conversion -console.log(val.toString(8)); // 12 ==> Octal Conversion -console.log(val.toString(16)); // A ==> Hexadecimal Conversion -``` +function getName() { + console.log(name); +} -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-decimal-to-binary-uhyi8t?file=/src/index.js)** +getName(); // Lydia +``` -## Q. ***How do you make first letter of the string in an uppercase?*** +## Q. What is the output? -You can create a function which uses chain of string methods such as charAt, toUpperCase and slice methods to generate a string with first letter in uppercase. +```javascript +function* generatorOne() { + yield ["a", "b", "c"]; +} -```js -function capitalizeFirstLetter(string) { - let arr = string.split(" "); - for (var i = 0; i < arr.length; i++) { - arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1); - } - return arr.join(" "); +function* generatorTwo() { + yield* ["a", "b", "c"]; } -console.log(capitalizeFirstLetter("hello world")); // Hello World +const one = generatorOne(); +const two = generatorTwo(); + +console.log(one.next().value); +console.log(two.next().value); ``` -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-capitalizefirstletter-dpjhky?file=/src/index.js)** +- A: `a` and `a` +- B: `a` and `undefined` +- C: `['a', 'b', 'c']` and `a` +- D: `a` and `['a', 'b', 'c']` - +**Answer: C** -## Q. ***Write a function which will test string as a literal and as an object?*** +With the `yield` keyword, we `yield` values in a generator function. With the `yield*` keyword, we can yield values from another generator function, or iterable object (for example an array). -The `typeof` operator can be use to test string literal and `instanceof` operator to test String object. +In `generatorOne`, we yield the entire array `['a', 'b', 'c']` using the `yield` keyword. The value of `value` property on the object returned by the `next` method on `one` (`one.next().value`) is equal to the entire array `['a', 'b', 'c']`. -```js -function check(str) { - if (str instanceof String) { - return "It is an object of string"; - } else { - if (typeof str === "string") { - return "It is a string literal"; - } else { - return "another type"; - } - } -} +```javascript +console.log(one.next().value); // ['a', 'b', 'c'] +console.log(one.next().value); // undefined +``` -var ltrlStr = "Hi I am string literal"; -var objStr = new String("Hi I am string object"); +In `generatorTwo`, we use the `yield*` keyword. This means that the first yielded value of `two`, is equal to the first yielded value in the iterator. The iterator is the array `['a', 'b', 'c']`. The first yielded value is `a`, so the first time we call `two.next().value`, `a` is returned. -console.log(check(ltrlStr)); // It is a string literal -console.log(check(objStr)); // It is an object of string +```javascript +console.log(two.next().value); // 'a' +console.log(two.next().value); // 'b' +console.log(two.next().value); // 'c' +console.log(two.next().value); // undefined ``` -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-literal-vs-object-978dqw?file=/src/index.js)** - -## Q. ***How do you reversing an array?*** - -You can use reverse() method is used reverse the elements in an array. This method is useful to sort an array in descending order. Let us see the usage of reverse() method in an example, +## Q. What is the output? -```js -let numbers = [1, 2, 5, 3, 4]; -numbers.sort((a, b) => b - a); -numbers.reverse(); -console.log(numbers); // [1, 2, 3, 4 ,5] +```javascript +console.log(`${((x) => x)("I love")} to program`); ``` +- A: `I love to program` +- B: `undefined to program` +- C: `${(x => x)('I love') to program` +- D: `TypeError` + +**Answer: A** + +Expressions within template literals are evaluated first. This means that the string will contain the returned value of the expression, the immediately invoked function `(x => x)('I love')` in this case. We pass the value `'I love'` as an argument to the `x => x` arrow function. `x` is equal to `'I love'`, which gets returned. This results in `I love to program`. + -## Q. ***How do you find min and max value in an array?*** +## Q. What will happen? -You can use `Math.min` and `Math.max` methods on array variable to find the minimum and maximum elements with in an array. -Let us create two functions to find the min and max value with in an array, - -```js -var marks = [50, 20, 70, 60, 45, 30]; -function findMin(arr) { - return Math.min.apply(null, arr); -} -function findMax(arr) { - return Math.max.apply(null, arr); -} +```javascript +let config = { + alert: setInterval(() => { + console.log("Alert!"); + }, 1000), +}; -console.log(findMin(marks)); -console.log(findMax(marks)); +config = null; ``` +- A: The `setInterval` callback won't be invoked +- B: The `setInterval` callback gets invoked once +- C: The `setInterval` callback will still be called every second +- D: We never invoked `config.alert()`, config is `null` + +**Answer: C** + +Normally when we set objects equal to `null`, those objects get _garbage collected_ as there is no reference anymore to that object. However, since the callback function within `setInterval` is an arrow function (thus bound to the `config` object), the callback function still holds a reference to the `config` object. As long as there is a reference, the object won't get garbage collected. Since it's not garbage collected, the `setInterval` callback function will still get invoked every 1000ms (1s). + -## Q. ***How do you find min and max values without Math functions?*** - -You can write functions which loops through an array comparing each value with the lowest value or highest value to find the min and max values. Let us create those functions to find min an max values, +## Q. Which method(s) will return the value `'Hello world!'`? -```js -var marks = [50, 20, 70, 60, 45, 30]; -function findMin(arr) { - var length = arr.length - var min = Infinity; - while (length--) { - if (arr[length] < min) { - min = arr[length]; - } - } - return min; -} +```javascript +const myMap = new Map(); +const myFunc = () => "greeting"; -function findMax(arr) { - var length = arr.length - var max = -Infinity; - while (length--) { - if (arr[length] > max) { - max = arr[length]; - } - } - return max; -} +myMap.set(myFunc, "Hello world!"); -console.log(findMin(marks)); -console.log(findMax(marks)); +//1 +myMap.get("greeting"); +//2 +myMap.get(myFunc); +//3 +myMap.get(() => "greeting"); ``` +- A: 1 +- B: 2 +- C: 2 and 3 +- D: All of them + +**Answer: B** + +When adding a key/value pair using the `set` method, the key will be the value of the first argument passed to the `set` function, and the value will be the second argument passed to the `set` function. The key is the _function_ `() => 'greeting'` in this case, and the value `'Hello world'`. `myMap` is now `{ () => 'greeting' => 'Hello world!' }`. + +1 is wrong, since the key is not `'greeting'` but `() => 'greeting'`. +3 is wrong, since we're creating a new function by passing it as a parameter to the `get` method. Object interact by _reference_. Functions are objects, which is why two functions are never strictly equal, even if they are identical: they have a reference to a different spot in memory. + -## Q. ***Write code for merge two JavaScript Object dynamically?*** - -Let say you have two objects +## Q. What is the output? -```js +```javascript const person = { - name: "Tanvi", - age: 28 + name: "Lydia", + age: 21, }; -const address = { - addressLine1: "Some Location x", - addressLine2: "Some Location y", - city: "Bangalore" +const changeAge = (x = { ...person }) => (x.age += 1); +const changeAgeAndName = (x = { ...person }) => { + x.age += 1; + x.name = "Sarah"; }; -``` -Write merge function which will take two object and add all the own property of second object into first object. +changeAge(person); +changeAgeAndName(); -```js -merge(person , address); - -/* Now person should have 5 properties -name , age , addressLine1 , addressLine2 , city */ +console.log(person); ``` -**Method 1: Using ES6, Object.assign method:** +- A: `{name: "Sarah", age: 22}` +- B: `{name: "Sarah", age: 23}` +- C: `{name: "Lydia", age: 22}` +- D: `{name: "Lydia", age: 23}` -```js -const merge = (toObj, fromObj) => Object.assign(toObj, fromObj); +**Answer: C** -console.log(merge(person, address)); -// {name: "Tanvi", age: 28, addressLine1: "Some Location x", addressLine2: "Some Location y", city: "Bangalore"} -``` +Both the `changeAge` and `changeAgeAndName` functions have a default parameter, namely a _newly_ created object `{ ...person }`. This object has copies of all the key/values in the `person` object. -**Method 2: Without using built-in function:** +First, we invoke the `changeAge` function and pass the `person` object as its argument. This function increases the value of the `age` property by 1. `person` is now `{ name: "Lydia", age: 22 }`. + +Then, we invoke the `changeAgeAndName` function, however we don't pass a parameter. Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it's a new object, it doesn't affect the values of the properties on the `person` object. `person` is still equal to `{ name: "Lydia", age: 22 }`. + + + +## Q. Predict the output ```js -function mergeObject(toObj, fromObj) { - // Make sure both of the parameter is an object - if (typeof toObj === "object" && typeof fromObj === "object") { - for (var pro in fromObj) { - // Assign only own properties not inherited properties - if (fromObj.hasOwnProperty(pro)) { - // Assign property and value - toObj[pro] = fromObj[pro]; - } - } - } else { - throw "Merge function can apply only on object"; - } -} +if(2 == true) // returns false -console.log(mergeObject(person, address)); -// {name: "Tanvi", age: 28, addressLine1: "Some Location x", addressLine2: "Some Location y", city: "Bangalore"} +if(2 == false) // returns false ``` -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-shallow-vs-deep-copy-ik5b7h?file=/src/index.js)** + ## Q. Predict the output @@ -8366,24 +8439,3 @@ function find_max(nums) { - -## Q. Create a Promise to accept car names as argument and send response once the argument matches with Maruti? - -```js -async function myCars(name) { - const promise = new Promise((resolve, reject) => { - name === "Maruti" ? resolve(name) : reject(name); - }); - - const result = await promise; - console.log(result); // "resolved!" -} - -myCars("Maruti"); -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-promise-1tmrnp?file=/src/index.js)** - - From e5f7fbe9781a25c0c5e719a2d759492082ba8a04 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 23 Oct 2022 11:48:37 +0530 Subject: [PATCH 028/117] Update README.md --- README.md | 5458 ++++++++++++++++++++++++++--------------------------- 1 file changed, 2644 insertions(+), 2814 deletions(-) diff --git a/README.md b/README.md index eea47db..27a5b42 100644 --- a/README.md +++ b/README.md @@ -706,6 +706,30 @@ console.log(findMax(marks)); ↥ back to top +## Q. Write a script that returns the number of occurrences of character given a string as input? + +```javascript +function countCharacters(str) { + return str + .replace(/ /g, "") + .toLowerCase() + .split("") + .reduce((arr, character) => { + if (character in arr) { + arr[character]++; + } else { + arr[character] = 1; + } + return arr; + }, {}); +} +console.log(countCharacters("the brown fox jumps over the lazy dog")); +``` + + + ## Q. Check if object is empty or not using javaScript?
Answer @@ -785,31 +809,22 @@ PASS ↥ back to top -## Q. Remove array element based on object property? +## Q. Write a script that returns the number of occurrences of character given a string as input
Answer ```javascript -var myArray = [ - { field: "id", operator: "eq" }, - { field: "cStatus", operator: "eq" }, - { field: "money", operator: "eq" }, -]; - -myArray = myArray.filter(function (obj) { - return obj.field !== "money"; -}); - -Console.log(myArray); -``` - -Output - -```js -myArray = [ - {field: "id", operator: "eq"} - {field: "cStatus", operator: "eq"} -] +function countCharacters(str) { + return str.replace(/ /g, "").toLowerCase().split("").reduce((p, c) => { + if (c in p) { + p[c]++; + } else { + p[c] = 1; + } + return p; + }, {}); +} +console.log(countCharacters("the brown fox jumps over the lazy dog")); ```
@@ -818,936 +833,1109 @@ myArray = [ ↥ back to top -## Q. Predict the output of the following JavaScript code? - -```javascript -console.log(+"meow"); -``` - -## Q. Predict the output of the following JavaScript code? +## Q. write a script that return the number of occurrences of a character in paragraph ```javascript -var result; -for (var i = 5; i > 0; i--) { - result = result + i; +function charCount(str, searchChar) { + let count = 0; + if (str) { + let stripStr = str.replace(/ /g, "").toLowerCase(); //remove spaces and covert to lowercase + for (let chr of stripStr) { + if (chr === searchChar) { + count++; + } + } + } + return count; } -console.log(result); +console.log(charCount("the brown fox jumps over the lazy dog", "o")); ``` -## Q. Predict the output of the following JavaScript code? + + +## Q. Recursive and non-recursive Factorial function ```javascript -var a = 1.2; -console.log(typeof a); -``` +function recursiveFactorial(n) { + if (n < 1) { + throw Error("Value of N has to be greater then 1"); + } + if (n === 1) { + return 1; + } else { + return n * recursiveFactorial(n - 1); + } +} -## Q. Predict the output of the following JavaScript code? +console.log(recursiveFactorial(5)); -```javascript -var x = 10; -if (x) { - let x = 4; +function factorial(n) { + if (n < 1) { + throw Error("Value of N has to be greater then 1"); + } + if (n === 1) { + return 1; + } + let result = 1; + for (let i = 1; i <= n; i++) { + result = result * i; + } + return result; } -console.log(x); + +console.log(factorial(5)); ``` -## Q. Predict the output of the following JavaScript code? +## Q. Recursive and non recursive fibonacci-sequence ```javascript -console.log(0.1 + 0.2 == 0.3); -``` +// 1, 1, 2, 3, 5, 8, 13, 21, 34 -## Q. Predict the output of the following JavaScript code? +function recursiveFibonacci(num) { + if (num <= 1) { + return 1; + } else { + return recursiveFibonacci(num - 1) + recursiveFibonacci(num - 2); + } +} -```javascript -console.log(1 + -"1" + 2); -``` +console.log(recursiveFibonacci(8)); -## Q. Predict the output of the following JavaScript code? +function fibonnaci(num) { + let a = 1, + b = 0, + temp; + while (num >= 0) { + temp = a; + a = a + b; + b = temp; + num--; + } + return b; +} -```javascript -(function (x) { - return (function (y) { - console.log(x); - })(10); -})(20); -``` +console.log(fibonnaci(7)); - +// Memoization fibonnaci -## Q. Predict the output of the following JavaScript code? +function fibonnaci(num, memo = {}) { + if (num in memo) { + return memo[num]; + } + if (num <= 1) { + return 1; + } + return (memo[num] = fibonnaci(num - 1, memo) + fibonnaci(num - 2, memo)); +} + +console.log(fibonnaci(5)); // 8 +``` + +## Q. Random Number between min and max ```javascript -var num = 20; -var getNumber = function () { - console.log(num); - var num = 10; -}; -getNumber(); +// 5 to 7 +let min = 5; +let max = 7; +console.log(min + Math.floor(Math.random() * (max - min + 1))); ``` -## Q. Predict the output of the following JavaScript code? +## Q. Get HTML form values as JSON object ```javascript -function f1() { - num = 10; -} -f1(); -console.log("window.num: " + window.num); -``` - -## Q. Predict the output of the following JavaScript code? +// Use the array reduce function with form elements. +const formToJSON = (elements) => + [].reduce.call( + elements, + (data, element) => { + data[element.name] = element.value; + // Check if name and value exist on element + // Check if it checkbox or radio button which can select multiple or single + //check for multiple select options + return data; + }, + {} + ); -```javascript -console.log("(null + undefined): " + (null + undefined)); +// pass the elements to above method, to get values +document.querySelector("HTML_FORM_CLASS").elements; ``` -## Q. Predict the output of the following JavaScript code? - -```javascript -(function () { - var a = (b = 3); -})(); - -console.log("value of a : " + a); -console.log("value of b : " + b); -``` + -## Q. Predict the output of the following JavaScript code? +## Q. Reverse the number ```javascript -var y = 1; -if (function f() {}) { - y += typeof f; +function reverse(num) { + let result = 0; + while (num != 0) { + result = result * 10; + result = result + (num % 10); + num = Math.floor(num / 10); + } + return result; } -console.log(y); -``` - -## Q. Predict the output of the following JavaScript code? -```javascript -var k = 1; -if (1) { - eval(function foo() {}); - k += typeof foo; -} -console.log(k); +console.log(reverse(12345)); ``` -## Q. Predict the output of the following JavaScript code? +## Q. Remove Duplicate elements from Array ```javascript -var k = 1; -if (1) { - function foo() {} - k += typeof foo; +var arr = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; +function removeDuplicate() { + return ar.reduce((prev, current) => { + //Cannot use includes of array, since it is not supported by many browser + if (prev.indexOf(current) === -1) { + prev.push(current); + } + return prev; + }, []); } -console.log(k); -``` - -## Q. Predict the output of the following JavaScript code? - -```javascript -console.log("(-1 / 0): " + -1 / 0); -console.log("(1 / 0): " + 1 / 0); -console.log("(0 / 0): " + 0 / 0); -console.log("(0 / 1): " + 0 / 1); -``` - -## Q. Predict the output of the following JavaScript code? +console.log(removeDuplicate(ar)); -```javascript -var a = 4; -var b = "5"; -var c = 6; +const removeDuplicates = (arr) => { + let holder = {}; + return arr.filter((el) => { + if (!holder[el]) { + holder[el] = true; + return true; + } + return false; + }); +}; +const arr = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; +console.log(removeDuplicates(arr)); // ["1", "2", "3", "5", "8", "9"] // O(n) -console.log("(a + b): " + (a + b)); -console.log("(a - b): " + (a - b)); -console.log("(a * b): " + a * b); -console.log("(a / b): " + a / b); -console.log("(a % b): " + (a % b)); +// Es6 +console.log([...new Set(arr)]); ``` -## Q. Predict the output of the following JavaScript code? +## Q. Deep copy of object or clone of object ```javascript -console.log("MAX : " + Math.max(10, 2, NaN)); -console.log("MAX : " + Math.max()); -``` - -## Q. Predict the output of the following JavaScript code? +function deepExtend(out = {}) { + for (let i = 1; i < arguments.length; i++) { + let obj = arguments[i]; + if (obj == null) + // skip undefined and null [check with double equal not triple] + continue; -```javascript -(function () { - var a = (b = 3); -})(); + obj = Object(obj); -console.log("a defined? " + (typeof a !== "undefined")); -console.log("b defined? " + (typeof b !== "undefined")); -``` + for (let key in obj) { + // avoid shadow hasownproperty of parent + if (Object.prototype.hasOwnProperty.call(obj, key)) { + if ( + typeof obj[key] === "object" && + !Array.isArray(obj[key]) && + obj[key] != null + ) + out[key] = deepExtend(out[key], obj[key]); + else out[key] = obj[key]; + } + } + } + return out; +} -## Q. Predict the output of the following JavaScript code? +//Alternative if there are no function +let cloneObj = JSON.parse(JSON.stringify(obj)); -```javascript -var myObject = { - foo: "bar", - func: function () { - var self = this; - console.log("outer func: this.foo = " + this.foo); - console.log("outer func: self.foo = " + self.foo); - (function () { - console.log("inner func: this.foo = " + this.foo); - console.log("inner func: self.foo = " + self.foo); - })(); - }, -}; -myObject.func(); +console.log(deepExtend({}, { a: 1, b: { c: 2, d: 3 } }, { e: 4, b: { f: 1 } })); +//output : { a: 1, b: {c: 2, d: 3, f: 1}, e: 4 } ``` -## Q. Predict the output of the following JavaScript code? - -```javascript -console.log(0.1 + 0.2); -console.log(0.1 + 0.2 == 0.3); -``` - -## Q. Predict the output of the following JavaScript code? +## Q. Sort ticket based on flying order. ```javascript -(function () { - console.log(1); - setTimeout(function () { - console.log(2); - }, 1000); - setTimeout(function () { - console.log(3); - }, 0); - console.log(4); -})(); -``` +"use strict"; -## Q. Predict the output of the following JavaScript code? +function SortTickets(tickets) { + this.tickets = tickets; -```javascript -var arr1 = "john".split(""); -var arr2 = arr1.reverse(); -var arr3 = "jones".split(""); + // reverse the order of tickets + this.reverseTickets = {}; + for (let key in this.tickets) { + this.reverseTickets[tickets[key]] = key; + } -arr2.push(arr3); + // Get the starting point of ticket + let orderedTivckets = [...this.getStartingPoint()]; -console.log("array 1: length=" + arr1.length + " last=" + arr1.slice(-1)); -console.log("array 2: length=" + arr2.length + " last=" + arr2.slice(-1)); -``` + // Get the ticket destination. + let currentValue = orderedTickets[orderedTickets.length - 1]; + while (currentValue) { + currentValue = this.tickets[currentValue]; + if (currentValue) { + orderedTickets.push(currentValue); + } + } + console.log(orderedTickets); +} -## Q. Predict the output of the following JavaScript code? +SortTickets.prototype.getStartingPoint = function () { + for (let tick in this.tickets) { + if (!(tick in this.reverseTickets)) { + return [tick, this.tickets[tick]]; + } + } + return null; +}; -```javascript -console.log(1 + "2" + "2"); -console.log(1 + +"2" + "2"); -console.log(1 + -"1" + "2"); -console.log(+"1" + "1" + "2"); -console.log("A" - "B" + "2"); -console.log("A" - "B" + 2); +new SortTickets({ + Athens: "Rio", + Barcelona: "Athens", + London: "NYC", + ND: "Lahore", + NYC: "Barcelona", + Rio: "ND", +}); ``` -## Q. Predict the output of the following JavaScript code? +## Q. Cuncurrent execute function based on input number ```javascript -for (var i = 0; i < 5; i++) { - setTimeout(function () { - console.log(i); - }, i * 1000); +function concurrent(num) { + this.queue = []; + this.num = num; } -``` -## Q. Predict the output of the following JavaScript code? +concurrent.prototype.enqueue = function (value) { + this.queue.push(value); +}; -```javascript -for (var i = 0; i < 5; i++) { - (function (x) { - setTimeout(function () { - console.log(x); - }, x * 1000); - })(i); -} -//Output:- 0, 1, 2, 3, 4 -``` +concurrent.prototype.start = function () { + this.runningCount = 0; + while (this.queue.length > 0) { + if (this.runningCount < this.num) { + this.queue.pop().call(this, () => { + this.runningCount--; + let count = this.runningCount; + if (count === 0) { + this.start(); + } + }); + this.runningCount++; + } + } +}; -## Q. Predict the output of the following JavaScript code? +let callback = (done) => { + console.log("starting"); + setTimeout(() => { + console.log("stopped"); + done(); + }, 200); +}; -```javascript -console.log("0 || 1 = " + (0 || 1)); -console.log("1 || 2 = " + (1 || 2)); -console.log("0 && 1 = " + (0 && 1)); -console.log("1 && 2 = " + (1 && 2)); +let c = new concurrent(2); +c.enqueue(callback); +c.enqueue(callback); +c.enqueue(callback); +c.enqueue(callback); +c.enqueue(callback); +c.enqueue(callback); +c.start(); ``` -## Q. Predict the output of the following JavaScript code? +## Q. Reversing an array ```javascript -console.log(false == "0"); -console.log(false === "0"); -``` +let a = [1, 2, 3, 4, 5]; -## Q. Predict the output of the following JavaScript code? +//Approach 1: +console.log(a.reverse()); -```javascript -var a = {}, - b = { key: "b" }, - c = { key: "c" }; +//Approach 2: +let reverse = a.reduce((prev, current) => { + prev.unshift(current); + return prev; +}, []); -a[b] = 123; -a[c] = 456; -console.log(a[b]); +console.log(reverse); ``` -## Q. Predict the output of the following JavaScript code? +## Q. Rotate 2D array ```javascript +const transpose = (arr) => arr[0].map((col, i) => arr.map((row) => row[i])); + console.log( - (function f(n) { - return n > 1 ? n * f(n - 1) : n; - })(10) + transpose([ + [1, 2, 3, 4], + [5, 6, 7, 8], + [9, 10, 11, 12], + ]) ); ``` -## Q. Predict the output of the following JavaScript code? +## Q. Get Column from 2D Array ```javascript -(function (x) { - return (function (y) { - console.log(x); //1 - })(2); -})(1); -``` - - - -## Q. Predict the output of the following JavaScript code? +const getColumn = (arr, n) => arr.map((x) => x[n]); -```javascript -var hero = { - _name: "John Doe", - getSecretIdentity: function () { - return this._name; - }, -}; -var stoleSecretIdentity = hero.getSecretIdentity; +const twoDimensionalArray = [ + [1, 2, 3], + [4, 5, 6], + [7, 8, 9], +]; -console.log(stoleSecretIdentity()); -console.log(hero.getSecretIdentity()); +console.log(getColumn(twoDimensionalArray, 1)); //Result = [2,5,8] ``` -## Q. Predict the output of the following JavaScript code? +## Q. Get top N from array ```javascript -var length = 10; -function fn() { - console.log(this.length); +function topN(arr, num) { + let sorted = arr.sort((a, b) => a - b); + return sorted.slice(sorted.length - num, sorted.length); } -var obj = { - length: 5, - method: function (fn) { - fn(); - arguments[0](); - }, -}; - -obj.method(fn, 1); +console.log(topN([1, 8, 3, 4, 5], 2)); // [5,8] ``` -## Q. Predict the output of the following JavaScript code? +## Q. Get query params from Object ```javascript -(function () { - try { - throw new Error(); - } catch (x) { - var x = 1, - y = 2; - console.log(x); +function getQueryParams(obj) { + let parms = ""; + for (let key in obj) { + if (obj.hasOwnProperty(key)) { + if (parms.length > 0) { + parms += "&"; + } + parms += encodeURI(`${key}=${obj[key]}`); + } } - console.log(x); - console.log(y); -})(); -``` - -## Q. Predict the output of the following JavaScript code? + return parms; +} -```javascript -var x = 21; -var girl = function () { - console.log(x); - var x = 20; -}; -girl(); +console.log( + getQueryParams({ + name: "Umesh", + tel: "48289", + add: "3333 emearld st", + }) +); ``` -## Q. Predict the output of the following JavaScript code? - -```javascript -console.log(1 < 2 < 3); -console.log(3 > 2 > 1); -``` + -## Q. Predict the output of the following JavaScript code? +## Q. Consecutive 1's in binary ```javascript -console.log(typeof typeof 1); -``` - -## Q. Predict the output of the following JavaScript code? +function consecutiveOne(num) { + let binaryArray = num.toString(2); -```javascript -var b = 1; -function outer() { - var b = 2; - function inner() { - b++; - var b = 3; - console.log(b); + let maxOccurence = 0, + occurence = 0; + for (let val of binaryArray) { + if (val === "1") { + occurence += 1; + maxOccurence = Math.max(maxOccurence, occurence); + } else { + occurence = 0; + } } - inner(); + return maxOccurence; } -outer(); +//13 = 1101 = 2 +//5 = 101 = 1 +console.log(consecutiveOne(5)); //1 ``` -## Q. Predict the output of the following JavaScript code? - -```javascript -x = 10; -console.log(x); -var x; -``` - -## Q. Predict the output of the following JavaScript code? +## Q. Spiral travesal of matrix ```javascript -const arr = [1, 2]; -arr.push(3); -``` +var input = [ + [1, 2, 3, 4], + [5, 6, 7, 8], + [9, 10, 11, 12], + [13, 14, 15, 16], +]; -## Q. Predict the output of the following JavaScript code? +var spiralTraversal = function (matriks) { + let result = []; + var goAround = function (matrix) { + if (matrix.length === 0) { + return; + } -```javascript -var o = new F(); -o.constructor === F; -``` + // right + result = result.concat(matrix.shift()); - + // down + for (var j = 0; j < matrix.length - 1; j++) { + result.push(matrix[j].pop()); + } -## Q. Predict the output of the following JavaScript code? + // bottom + result = result.concat(matrix.pop().reverse()); -```javascript -let sum = (a, b) => { - a + b; -}; -console.log(sum(10, 20)); -``` + // up + for (var k = matrix.length - 1; k > 0; k--) { + result.push(matrix[k].shift()); + } -## Q. Predict the output of the following JavaScript code? + return goAround(matrix); + }; -```javascript -var arr = ["javascript", "typescript", "es6"]; + goAround(matriks); -var searchValue = (value) => { - return arr.filter((item) => { - return item.indexOf(value) > -1; - }); + return result; }; - -console.log(searchValue("script")); -``` - -## Q. Write a program that prints the numbers from 1 to 15. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”? - -**Example:** - -```js -Input: 15 -Output: -1 -2 -Fizz -4 -Buzz -Fizz -7 -8 -Fizz -Buzz -11 -Fizz -13 -14 -FizzBuzz +console.log(spiralTraversal(input)); // [1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10] ``` -
Answer + -**Solution - 01:** +## Q. Merge Sorted array and sort it. ```javascript -for (var i = 1; i <= 15; i++) { - if (i % 15 == 0) console.log("FizzBuzz"); - else if (i % 3 == 0) console.log("Fizz"); - else if (i % 5 == 0) console.log("Buzz"); - else console.log(i); +function mergeSortedArray(arr1, arr2) { + return [...new Set(arr1.concat(arr2))].sort((a, b) => a - b); } -``` - -**Solution - 02:** -```javascript -for (var i = 1; i <= 15; i++) { - var f = i % 3 == 0, - b = i % 5 == 0; - console.log(f ? (b ? "FizzBuzz" : "Fizz") : b ? "Buzz" : i); -} +console.log(mergeSortedArray([1, 2, 3, 4, 5, 6], [0, 3, 4, 7])); // [0, 1, 2, 3, 4, 5, 6, 7] ``` -
- -## Q. What will be the output of the following code? +## Q. Anagram of words ```javascript -var output = (function (x) { - delete x; - return x; -})(0); - -console.log(output); -``` - -
Answer +const alphabetize = (word) => word.split("").sort().join(""); -The code above will output `0` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **local variable**. `delete` operator doesn't affect local variables. +function groupAnagram(wordsArr) { + return wordsArr.reduce((p, c) => { + const sortedWord = alphabetize(c); + if (sortedWord in p) { + p[sortedWord].push(c); + } else { + p[sortedWord] = [c]; + } + return p; + }, {}); +} -
+console.log( + groupAnagram(["map", "art", "how", "rat", "tar", "who", "pam", "shoop"]) +); +// result : { +// amp: ["map", "pam"], +// art: ["art", "rat", "tar"], +// hoops: ["shoop"], +// how: ["how", "who"] +// } +``` -## Q. What will be the output of the following code? +## Q. Print the largest (maximum) hourglass sum found in 2d array. ```javascript -var x = 1; -var output = (function () { - delete x; - return x; -})(); +// if arr 6 X 6 then iterate it till 4 X 4 [reduce by two] +// if arr 8 X 8 then iterate it till 6 X 6 [reduce by two] +function main(arr) { + let maxScore = -999; + let len = arr.length; + for (let i = 0; i < len - 2; i++) { + for (let j = 0; j < len - 2; j++) { + let total = + arr[i][j] + + arr[i][j + 1] + + arr[i][j + 2] + + arr[i + 1][j + 1] + + arr[i + 2][j] + + arr[i + 2][j + 1] + + arr[i + 2][j + 2]; -console.log(output); + maxScore = Math.max(maxScore, total); + } + } + console.log(maxScore); +} ``` -
Answer - -The code above will output `1` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **global variable** of type `number`. - -
- -## Q. What will be the output of the following code? +## Q. Transform array of object to array ```javascript -var x = { foo: 1 }; -var output = (function () { - delete x.foo; - return x.foo; -})(); - -console.log(output); -``` +let data = [ + { vid: "aaa", san: 12 }, + { vid: "aaa", san: 18 }, + { vid: "aaa", san: 2 }, + { vid: "bbb", san: 33 }, + { vid: "bbb", san: 44 }, + { vid: "aaa", san: 100 }, +]; -
Answer +let newData = data.reduce((acc, item) => { + acc[item.vid] = acc[item.vid] || { vid: item.vid, san: [] }; + acc[item.vid]["san"].push(item.san); + return acc; +}, {}); -The code above will output `undefined` as output. `delete` operator is used to delete a property from an object. Here `x` is an object which has foo as a property and from a self-invoking function, we are deleting the `foo` property of object `x` and after deletion, we are trying to reference deleted property `foo` which result `undefined`. +console.log(Object.keys(newData).map((key) => newData[key])); -
+// Result +// [[object Object] { +// san: [12, 18, 2, 100], +// vid: "aaa" +// }, [object Object] { +// san: [33, 44], +// vid: "bbb" +// }] +``` -## Q. What will be the output of the following code? +## Q. Create a private variable or private method in object ```javascript -var Employee = { - company: "xyz", -}; -var emp1 = Object.create(Employee); -delete emp1.company; -console.log(emp1.company); -``` - -
Answer - -The code above will output `xyz` as output. Here `emp1` object got company as **prototype** property. delete operator doesn't delete prototype property. - -`emp1` object doesn't have **company** as its own property. you can test it `console.log(emp1.hasOwnProperty('company')); //output : false` However, we can delete company property directly from `Employee` object using `delete Employee.company` or we can also delete from `emp1` object using `__proto__` property `delete emp1.__proto__.company`. +let obj = (function () { + function getPrivateFunction() { + console.log("this is private function"); + } + let p = "You are accessing private variable"; + return { + getPrivateProperty: () => { + console.log(p); + }, + callPrivateFunction: getPrivateFunction, + }; +})(); -
+obj.getPrivateValue(); // You are accessing private variable +console.log("p" in obj); // false +obj.callPrivateFunction(); // this is private function +``` -## Q. What will be the output of the following code? +## Q. Flatten only Array not objects ```javascript -var trees = ["xyz", "xxxx", "test", "ryan", "apple"]; -delete trees[3]; -console.log(trees.length); -``` +function flatten(arr, result = []) { + arr.forEach((val) => { + if (Array.isArray(val)) { + flatten(val, result); + } else { + result.push(val); + } + }); + return result; +} -
Answer +let input = [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; +console.log(flatten(input)); // [1, { a: [2, [3]]}, 4, 5, 6, 7, "hi", 8, 9, 10] -The code above will output `5` as output. When we used `delete` operator for deleting an array element then, the array length is not affected by this. This holds even if you deleted all elements of an array using `delete` operator. +function flattenIterative(out) { + // iteratively + let result = out; + while (result.some(Array.isArray)) { + result = [].concat.apply([], result); + } + return result; +} +var list1 = [ + [0, 1], + [2, 3], + [4, 5], +]; +console.log(flattenIterative(list1)); // [0, 1, 2, 3, 4, 5] -So when delete operator removes an array element that deleted element is no longer present in the array. In place of value at deleted index `undefined x 1` in **chrome** and `undefined` is placed at the index. If you do `console.log(trees)` output `["xyz", "xxxx", "test", undefined × 1, "apple"]` in Chrome and in Firefox `["xyz", "xxxx", "test", undefined, "apple"]`. +function flattenIterative1(current) { + let result = []; + while (current.length) { + let firstValue = current.shift(); + if (Array.isArray(firstValue)) { + current = firstValue.concat(current); + } else { + result.push(firstValue); + } + } + return result; +} -
+let input = [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; +console.log(flattenIterative1(input)); +var list2 = [0, [1, [2, [3, [4, [5]]]]]]; +console.log(flattenIterative1(list2)); // [0, 1, 2, 3, 4, 5] +``` -## Q. What will be the output of the following code? +## Q. Find max difference between two number in Array ```javascript -var bar = true; -console.log(bar + 0); -console.log(bar + "xyz"); -console.log(bar + true); -console.log(bar + false); -``` +function maxDifference(arr) { + let maxDiff = 0; -
Answer + for (let i = 0; i < arr.length; i++) { + for (let j = i + 1; j < arr.length; j++) { + let diff = Math.abs(arr[i] - arr[j]); + maxDiff = Math.max(maxDiff, diff); + } + } + return maxDiff; +} -The code above will output `1, "truexyz", 2, 1` as output. Here's a general guideline for the plus operator: +console.log(maxDifference([1, 2, 4])); // [1 - 4 ] = 3 +``` -- Number + Number -> Addition -- Boolean + Number -> Addition -- Boolean + Boolean -> Addition -- Number + String -> Concatenation -- String + Boolean -> Concatenation -- String + String -> Concatenation +## Q. swap two number in ES6 [destructing] -
+```javascript +let a = 10, + b = 5; +[a, b] = [b, a]; +``` -## Q. What will be the output of the following code? +## Q. Panagram ? it means all the 26 letters of alphabet are there ```javascript -var z = 1, - y = (z = typeof y); -console.log(y); -``` - -
Answer - -The code above will print string `"undefined"` as output. According to associativity rule operator with the same precedence are processed based on their associativity property of operator. Here associativity of the assignment operator is `Right to Left` so first `typeof y` will evaluate first which is string `"undefined"` and assigned to `z` and then `y` would be assigned the value of z. The overall sequence will look like that: +function panagram(input) { + if (input == null) { + // Check for null and undefined + return false; + } -```javascript -var z; -z = 1; -var y; -z = typeof y; -y = z; + if (input.length < 26) { + // if length is less then 26 then it is not + return false; + } + input = input.replace(/ /g, "").toLowerCase().split(""); + let obj = input.reduce((prev, current) => { + if (!(current in prev)) { + prev[current] = current; + } + return prev; + }, {}); + console.log(Object.keys(obj).length === 26 ? "panagram" : "not pangram"); +} +processData("We promptly judged antique ivory buckles for the next prize"); // pangram +processData("We promptly judged antique ivory buckles for the prize"); // Not Pangram ``` -
+ -## Q. What will be the output of the following code? +## Q. Given two identical DOM trees (not the same one), and a node from one of them find the node in the other one. ```javascript -// NFE (Named Function Expression) -var foo = function bar() { - return 12; -}; -typeof bar(); -``` +function indexOf(arrLike, target) { + return Array.prototype.indexOf.call(arrLike, target); +} -
Answer +// Given a node and a tree, extract the nodes path +function getPath(root, target) { + var current = target; + var path = []; + while (current !== root) { + let parentNode = current.parentNode; + path.unshift(indexOf(parentNode.childNodes, current)); + current = parentNode; + } + return path; +} -The output will be `Reference Error`. To fix the bug we can try to rewrite the code a little bit: +// Given a tree and a path, let's locate a node +function locateNodeFromPath(node, path) { + return path.reduce((root, index) => root.childNodes[index], node); +} -**Sample 1:** +const rootA = document.querySelector("#root-a"); +const rootB = document.querySelector("#root-b"); +const target = rootA.querySelector(".person__age"); -```javascript -var bar = function () { - return 12; -}; -typeof bar(); +console.log(locateNodeFromPath(rootB, getPath(rootA, target))); ``` -or + -**Sample 2:** +## Q. Convert a number into a Roman Numeral ```javascript -function bar() { - return 12; +function romanize(num) { + let lookup = { + M: 1000, + CM: 900, + D: 500, + CD: 400, + C: 100, + XC: 90, + L: 50, + XL: 40, + X: 10, + IX: 9, + V: 5, + IV: 4, + I: 1, + }, + roman = ""; + for (let i in lookup) { + while (num >= lookup[i]) { + roman += i; + num -= lookup[i]; + } + } + return roman; } -typeof bar(); -``` - -The function definition can have only one reference variable as a function name, In **sample 1** `bar` is reference variable which is pointing to `anonymous function` and in **sample 2** we have function statement and `bar` is the function name. -```javascript -var foo = function bar() { - // foo is visible here - // bar is visible here - console.log(typeof bar()); // Works here :) -}; -// foo is visible here -// bar is undefined here +console.log(romanize(3)); // III ``` -
- -## Q. What is the output of the following? +## Q. check if parenthesis is malformed or not ```javascript -bar(); -(function abc() { - console.log("something"); -})(); -function bar() { - console.log("bar got called"); +function matchParenthesis(str) { + let obj = { "{": "}", "(": ")", "[": "]" }; + let result = []; + for (let s of str) { + if (s === "{" || s === "(" || s === "[") { + // All opening brackets + result.push(s); + } else { + if (result.length > 0) { + let lastValue = result.pop(); //pop the last value and compare with key + if (obj[lastValue] !== s) { + // if it is not same then it is not formated properly + return false; + } + } else { + return false; // empty array, there is nothing to pop. so it is not formated properly + } + } + } + return result.length === 0; } -``` - -
Answer - -The output will be : -```js -bar got called -something +console.log(matchParenthesis("}{{}}"), matchParenthesis("{{[]}}")); // false - true ``` -Since the function is called first and defined during parse time the JS engine will try to find any possible parse time definitions and start the execution loop which will mean function is called first even if the definition is post another function. - -
- -## Q. What will be the output of the following code? +## Q. Create Custom Event Emitter class ```javascript -var salary = "1000$"; +class EventEmitter { + constructor() { + this.holder = {}; + } -(function () { - console.log("Original salary was " + salary); + on(eventName, fn) { + if (eventName && typeof fn === "function") { + this.holder[eventName] = this.holder[eventName] || []; + this.holder[eventName].push(fn); + } + } - var salary = "5000$"; + emit(eventName, ...args) { + let eventColl = this.holder[eventName]; + if (eventColl) { + eventColl.forEach((callback) => callback(args)); + } + } +} - console.log("My New Salary " + salary); -})(); +let e = new EventEmitter(); +e.on("callme", function (args) { + console.log(`you called me ${args}`); +}); +e.on("callme", function (args) { + console.log(`testing`); +}); + +e.emit("callme", ["a", "b"], { firstName: "umesh", lastName: "gohil" }); ``` -
Answer + -The code above will output: `undefined, 5000$` because of hoisting. In the code presented above, you might be expecting `salary` to retain it values from outer scope until the point that `salary` was re-declared in the inner scope. But due to `hoisting` salary value was `undefined` instead. To understand it better have a look of the following code, here `salary` variable is hoisted and declared at the top in function scope. When we print its value using `console.log` the result is `undefined`. Afterwards the variable is redeclared and the new value `"5000$"` is assigned to it. +## Q. Max value from an array ```javascript -var salary = "1000$"; - -(function () { - var salary = undefined; - console.log("Original salary was " + salary); - - salary = "5000$"; +const arr = [-2, -3, 4, 3, 2, 1]; +Math.max(...arr); // Fastest - console.log("My New Salary " + salary); -})(); +Math.max.apply(Math, arr); // Slow ``` -
- -## Q. What would be the output of the following code? +## Q. Move all zero's to end ```javascript -function User(name) { - this.name = name || "JsGeeks"; -} +const moveZeroToEnd = (arr) => { + for (let i = 0, j = 0; j < arr.length; j++) { + if (arr[j] !== 0) { + if (i < j) { + [arr[i], arr[j]] = [arr[j], arr[i]]; // swap i and j + } + i++; + } + } + return arr; +}; -var person = (new User("xyz")["location"] = "USA"); -console.log(person); +console.log(moveZeroToEnd([1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0])); // [1, 8, 2, 3, 4, 5, 0, 0, 0, 0, 0] ``` -
Answer + -The output of above code would be `"USA"`. Here `new User("xyz")` creates a brand new object and created property `location` on that and `USA` has been assigned to object property location and that has been referenced by the person. +## Q. Decode message in matrix [diagional down right, diagional up right] -Let say `new User("xyz")` created a object called `foo`. The value `"USA"` will be assigned to `foo["location"]`, but according to [ECMAScript Specification](http://www.ecma-international.org/ecma-262/6.0/#sec-assignment-operators-runtime-semantics-evaluation) , pt 12.14.4 the assignment will itself return the rightmost value: in our case it's `"USA"`. -Then it will be assigned to person. +```javascript +const decodeMessage = (mat) => { + // check if matrix is null or empty + if (mat == null || mat.length === 0) { + return ""; + } + let x = mat.length - 1; + let y = mat[0].length - 1; + let message = ""; + let decode = (mat, i = 0, j = 0, direction = "DOWN") => { + message += mat[i][j]; -To better understand What is going on here, try to execute this code in console, line by line: + if (i === x) { + direction = "UP"; + } -```javascript -function User(name) { - this.name = name || "JS"; -} + if (direction === "DOWN") { + i++; + } else { + i--; + } + + if (j === y) { + return; + } + + j++; + decode(mat, i, j, direction); + }; + decode(mat); + return message; +}; + +let mat = [ + ["I", "B", "C", "A", "L", "K", "A"], + ["D", "R", "F", "C", "A", "E", "A"], + ["G", "H", "O", "E", "L", "A", "D"], + ["G", "H", "O", "E", "L", "A", "D"], +]; -var person; -var foo = new User("xyz"); -foo["location"] = "USA"; -// the console will show you that the result of this is "USA" +console.log(decodeMessage(mat)); //IROELEA ``` -
- -## Q. What would be the output of following code? +## Q. find a pair in array, whose sum is equal to given number. ```javascript -var strA = "hi there"; -var strB = strA; -strB = "bye there!"; -console.log(strA); -``` +const hasPairSum = (arr, sum) => { + if (arr == null && arr.length < 2) { + return false; + } -
Answer + let left = 0; + let right = arr.length - 1; + let result = false; -The output will `'hi there'` because we're dealing with strings here. Strings are -passed by value, that is, copied. + while (left < right && !result) { + let pairSum = arr[left] + arr[right]; + if (pairSum < sum) { + left++; + } else if (pairSum > sum) { + right--; + } else { + result = true; + } + } + return result; +}; -
+console.log(hasPairSum([1, 2, 4, 5], 8)); // null +console.log(hasPairSum([1, 2, 4, 4], 8)); // [2,3] + +const hasPairSum = (arr, sum) => { + let difference = {}; + let hasPair = false; + arr.forEach((item) => { + let diff = sum - item; + if (!difference[diff]) { + difference[item] = true; + } else { + hasPair = true; + } + }); + return hasPair; +}; +console.log(hasPairSum([6, 4, 3, 8], 8)); + +// NOTE: if array is not sorted then subtract the value with sum and store in difference +// then see if that value exist in difference then return true. +``` -## Q. What would be the output of following code? +## Q. Binary Search [Array should be sorted] ```javascript -var objA = { prop1: 42 }; -var objB = objA; -objB.prop1 = 90; -console.log(objA); -``` +function binarySearch(arr, val) { + let startIndex = 0, + stopIndex = arr.length - 1, + middleIndex = Math.floor((startIndex + stopIndex) / 2); -
Answer + while (arr[middleIndex] !== val && startIndex < stopIndex) { + if (val < arr[middleIndex]) { + stopIndex = middleIndex - 1; + } else if (val > arr[middleIndex]) { + startIndex = middleIndex + 1; + } + middleIndex = Math.floor((startIndex + stopIndex) / 2); + } -The output will `{prop1: 90}` because we're dealing with objects here. Objects are -passed by reference, that is, `objA` and `objB` point to the same object in memory. + return arr[middleIndex] === val ? middleIndex : -1; +} -
+console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 22)); +console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 27)); +``` -## Q. What would be the output of following code? +## Q. Write a function to generate Pascal triangle? ```javascript -var objA = { prop1: 42 }; -var objB = objA; -objB = {}; -console.log(objA); -``` - -
Answer - -The output will `{prop1: 42}`. - -When we assign `objA` to `objB`, the `objB` variable will point -to the same object as the `objB` variable. - -However, when we reassign `objB` to an empty object, we simply change where `objB` variable references to. -This doesn\'t affect where `objA` variable references to. +function pascalTriangle(n) { + let last = [1], + triangle = [last]; + for (let i = 0; i < n; i++) { + const ls = [0].concat(last), //[0,1] // [0,1,1] + rs = last.concat([0]); //[1,0] // [1,1,0] + last = rs.map((r, i) => ls[i] + r); //[1, 1] // [1,2,1] + triangle = triangle.concat([last]); // [[1], [1,1]] // [1], [1, 1], [1, 2, 1] + } + return triangle; +} -
+console.log(pascalTriangle(2)); +``` -## Q. What would be the output of following code? +## Q. Remove array element based on object property? + +
Answer ```javascript -var arrA = [0, 1, 2, 3, 4, 5]; -var arrB = arrA; -arrB[0] = 42; -console.log(arrA); -``` +var myArray = [ + { field: "id", operator: "eq" }, + { field: "cStatus", operator: "eq" }, + { field: "money", operator: "eq" }, +]; -
Answer +myArray = myArray.filter(function (obj) { + return obj.field !== "money"; +}); -The output will be `[42,1,2,3,4,5]`. +Console.log(myArray); +``` -Arrays are object in JavaScript and they are passed and assigned by reference. This is why -both `arrA` and `arrB` point to the same array `[0,1,2,3,4,5]`. That's why changing the first -element of the `arrB` will also modify `arrA`: it's the same array in the memory. +Output + +```js +myArray = [ + {field: "id", operator: "eq"} + {field: "cStatus", operator: "eq"} +] +```
@@ -1755,476 +1943,557 @@ element of the `arrB` will also modify `arrA`: it's the same array in the memory ↥ back to top -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? ```javascript -var arrA = [0, 1, 2, 3, 4, 5]; -var arrB = arrA.slice(); -arrB[0] = 42; -console.log(arrA); +console.log(+"meow"); ``` -
Answer - -The output will be `[0,1,2,3,4,5]`. - -The `slice` function copies all the elements of the array returning the new array. That's why -`arrA` and `arrB` reference two completely different arrays. - -
- - - -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? ```javascript -var arrA = [ - { prop1: "value of array A!!" }, - { someProp: "also value of array A!" }, - 3, - 4, - 5, -]; -var arrB = arrA; -arrB[0].prop1 = 42; -console.log(arrA); +var result; +for (var i = 5; i > 0; i--) { + result = result + i; +} +console.log(result); ``` -
Answer +## Q. Predict the output of the following JavaScript code? -The output will be `[{prop1: 42}, {someProp: "also value of array A!"}, 3,4,5]`. +```javascript +var a = 1.2; +console.log(typeof a); +``` -Arrays are object in JS, so both varaibles arrA and arrB point to the same array. Changing -`arrB[0]` is the same as changing `arrA[0]` +## Q. Predict the output of the following JavaScript code? -
+```javascript +var x = 10; +if (x) { + let x = 4; +} +console.log(x); +``` -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? ```javascript -var arrA = [ - { prop1: "value of array A!!" }, - { someProp: "also value of array A!" }, - 3, - 4, - 5, -]; -var arrB = arrA.slice(); -arrB[0].prop1 = 42; -arrB[3] = 20; -console.log(arrA); +console.log(0.1 + 0.2 == 0.3); ``` -
Answer +## Q. Predict the output of the following JavaScript code? -The output will be `[{prop1: 42}, {someProp: "also value of array A!"}, 3,4,5]`. +```javascript +console.log(1 + -"1" + 2); +``` -The `slice` function copies all the elements of the array returning the new array. However, -it doesn't do deep copying. Instead it does shallow copying. You can imagine slice implemented like this: +## Q. Predict the output of the following JavaScript code? ```javascript -function slice(arr) { - var result = []; - for (i = 0; i < arr.length; i++) { - result.push(arr[i]); - } - return result; -} +(function (x) { + return (function (y) { + console.log(x); + })(10); +})(20); ``` -Look at the line with `result.push(arr[i])`. If `arr[i]` happens to be a number or string, -it will be passed by value, in other words, copied. If `arr[i]` is an object, it will be passed by reference. - -In case of our array `arr[0]` is an object `{prop1: "value of array A!!"}`. Only the reference -to this object will be copied. This effectively means that arrays arrA and arrB share first -two elements. + -This is why changing the property of `arrB[0]` in `arrB` will also change the `arrA[0]`. +## Q. Predict the output of the following JavaScript code? -
+```javascript +var num = 20; +var getNumber = function () { + console.log(num); + var num = 10; +}; +getNumber(); +``` -## Q. console.log(employeeId); - -
Answer +## Q. Predict the output of the following JavaScript code? -_Answer:_ ReferenceError: employeeId is not defined +```javascript +function f1() { + num = 10; +} +f1(); +console.log("window.num: " + window.num); +``` -
+## Q. Predict the output of the following JavaScript code? - +```javascript +console.log("(null + undefined): " + (null + undefined)); +``` -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? ```javascript -console.log(employeeId); -var employeeId = "19000"; +(function () { + var a = (b = 3); +})(); + +console.log("value of a : " + a); +console.log("value of b : " + b); ``` -
Answer +## Q. Predict the output of the following JavaScript code? -_Answer:_ undefined +```javascript +var y = 1; +if (function f() {}) { + y += typeof f; +} +console.log(y); +``` -
+## Q. Predict the output of the following JavaScript code? + +```javascript +var k = 1; +if (1) { + eval(function foo() {}); + k += typeof foo; +} +console.log(k); +``` -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? ```javascript -var employeeId = "1234abe"; -(function () { - console.log(employeeId); - var employeeId = "122345"; -})(); +var k = 1; +if (1) { + function foo() {} + k += typeof foo; +} +console.log(k); ``` -
Answer +## Q. Predict the output of the following JavaScript code? -_Answer:_ 2) undefined +```javascript +console.log("(-1 / 0): " + -1 / 0); +console.log("(1 / 0): " + 1 / 0); +console.log("(0 / 0): " + 0 / 0); +console.log("(0 / 1): " + 0 / 1); +``` -
+## Q. Predict the output of the following JavaScript code? + +```javascript +var a = 4; +var b = "5"; +var c = 6; + +console.log("(a + b): " + (a + b)); +console.log("(a - b): " + (a - b)); +console.log("(a * b): " + a * b); +console.log("(a / b): " + a / b); +console.log("(a % b): " + (a % b)); +``` -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? + +```javascript +console.log("MAX : " + Math.max(10, 2, NaN)); +console.log("MAX : " + Math.max()); +``` + +## Q. Predict the output of the following JavaScript code? ```javascript -var employeeId = "1234abe"; (function () { - console.log(employeeId); - var employeeId = "122345"; - (function () { - var employeeId = "abc1234"; - })(); + var a = (b = 3); })(); + +console.log("a defined? " + (typeof a !== "undefined")); +console.log("b defined? " + (typeof b !== "undefined")); ``` -
Answer +## Q. Predict the output of the following JavaScript code? -```js -undefined +```javascript +var myObject = { + foo: "bar", + func: function () { + var self = this; + console.log("outer func: this.foo = " + this.foo); + console.log("outer func: self.foo = " + self.foo); + (function () { + console.log("inner func: this.foo = " + this.foo); + console.log("inner func: self.foo = " + self.foo); + })(); + }, +}; +myObject.func(); ``` -
- -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? + +```javascript +console.log(0.1 + 0.2); +console.log(0.1 + 0.2 == 0.3); +``` + +## Q. Predict the output of the following JavaScript code? ```javascript (function () { - console.log(typeof displayFunc); - var displayFunc = function () { - console.log("Hi I am inside displayFunc"); - }; + console.log(1); + setTimeout(function () { + console.log(2); + }, 1000); + setTimeout(function () { + console.log(3); + }, 0); + console.log(4); })(); ``` -
Answer +## Q. Predict the output of the following JavaScript code? -_Answer:_ undefined +```javascript +var arr1 = "john".split(""); +var arr2 = arr1.reverse(); +var arr3 = "jones".split(""); -
+arr2.push(arr3); - +console.log("array 1: length=" + arr1.length + " last=" + arr1.slice(-1)); +console.log("array 2: length=" + arr2.length + " last=" + arr2.slice(-1)); +``` -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? ```javascript -var employeeId = "abc123"; -function foo() { - employeeId = "123bcd"; - return; -} -foo(); -console.log(employeeId); +console.log(1 + "2" + "2"); +console.log(1 + +"2" + "2"); +console.log(1 + -"1" + "2"); +console.log(+"1" + "1" + "2"); +console.log("A" - "B" + "2"); +console.log("A" - "B" + 2); ``` -
Answer - -_Answer:_ '123bcd' - -
- - -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? ```javascript -var employeeId = "abc123"; +for (var i = 0; i < 5; i++) { + setTimeout(function () { + console.log(i); + }, i * 1000); +} +``` -function foo() { - employeeId = "123bcd"; - return; +## Q. Predict the output of the following JavaScript code? - function employeeId() {} +```javascript +for (var i = 0; i < 5; i++) { + (function (x) { + setTimeout(function () { + console.log(x); + }, x * 1000); + })(i); } -foo(); -console.log(employeeId); +//Output:- 0, 1, 2, 3, 4 ``` -
Answer - -_Answer:_ 'abc123' +## Q. Predict the output of the following JavaScript code? -
+```javascript +console.log("0 || 1 = " + (0 || 1)); +console.log("1 || 2 = " + (1 || 2)); +console.log("0 && 1 = " + (0 && 1)); +console.log("1 && 2 = " + (1 && 2)); +``` -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? ```javascript -var employeeId = "abc123"; +console.log(false == "0"); +console.log(false === "0"); +``` -function foo() { - employeeId(); - return; +## Q. Predict the output of the following JavaScript code? - function employeeId() { - console.log(typeof employeeId); - } -} -foo(); +```javascript +var a = {}, + b = { key: "b" }, + c = { key: "c" }; + +a[b] = 123; +a[c] = 456; +console.log(a[b]); +``` + +## Q. Predict the output of the following JavaScript code? + +```javascript +console.log( + (function f(n) { + return n > 1 ? n * f(n - 1) : n; + })(10) +); ``` -
Answer - -_Answer:_ 'function' +## Q. Predict the output of the following JavaScript code? -
+```javascript +(function (x) { + return (function (y) { + console.log(x); //1 + })(2); +})(1); +``` -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? ```javascript -function foo() { - employeeId(); - var product = "Car"; - return; +var hero = { + _name: "John Doe", + getSecretIdentity: function () { + return this._name; + }, +}; +var stoleSecretIdentity = hero.getSecretIdentity; - function employeeId() { - console.log(product); - } -} -foo(); +console.log(stoleSecretIdentity()); +console.log(hero.getSecretIdentity()); ``` -
Answer +## Q. Predict the output of the following JavaScript code? -_Answer:_ 1) undefined +```javascript +var length = 10; +function fn() { + console.log(this.length); +} -
+var obj = { + length: 5, + method: function (fn) { + fn(); + arguments[0](); + }, +}; + +obj.method(fn, 1); +``` -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? ```javascript -(function foo() { - bar(); - - function bar() { - abc(); - console.log(typeof abc); - } - - function abc() { - console.log(typeof bar); +(function () { + try { + throw new Error(); + } catch (x) { + var x = 1, + y = 2; + console.log(x); } + console.log(x); + console.log(y); })(); ``` -
Answer - -_Answer:_ function function - -
+## Q. Predict the output of the following JavaScript code? - +```javascript +var x = 21; +var girl = function () { + console.log(x); + var x = 20; +}; +girl(); +``` -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? ```javascript -(function () { - "use strict"; - - var person = { - name: "John", - }; - person.salary = "10000$"; - person["country"] = "USA"; +console.log(1 < 2 < 3); +console.log(3 > 2 > 1); +``` - Object.defineProperty(person, "phoneNo", { - value: "8888888888", - enumerable: true, - }); +## Q. Predict the output of the following JavaScript code? - console.log(Object.keys(person)); -})(); +```javascript +console.log(typeof typeof 1); ``` -
Answer - -_Answer:_ ["name", "salary", "country", "phoneNo"] +## Q. Predict the output of the following JavaScript code? -
+```javascript +var b = 1; +function outer() { + var b = 2; + function inner() { + b++; + var b = 3; + console.log(b); + } + inner(); +} +outer(); +``` -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? ```javascript -(function () { - "use strict"; - - var person = { - name: "John", - }; - person.salary = "10000$"; - person["country"] = "USA"; +x = 10; +console.log(x); +var x; +``` - Object.defineProperty(person, "phoneNo", { - value: "8888888888", - enumerable: false, - }); +## Q. Predict the output of the following JavaScript code? - console.log(Object.keys(person)); -})(); +```javascript +const arr = [1, 2]; +arr.push(3); ``` -
Answer - -_Answer:_ ["name", "salary", "country"] +## Q. Predict the output of the following JavaScript code? -
+```javascript +var o = new F(); +o.constructor === F; +``` -## Q. What would be the output of following code? +## Q. Predict the output of the following JavaScript code? ```javascript -(function () { - var objA = { - foo: "foo", - bar: "bar", - }; - var objB = { - foo: "foo", - bar: "bar", - }; - console.log(objA == objB); - console.log(objA === objB); -})(); +let sum = (a, b) => { + a + b; +}; +console.log(sum(10, 20)); ``` -
Answer +## Q. Predict the output of the following JavaScript code? -_Answer:_ 2) false false +```javascript +var arr = ["javascript", "typescript", "es6"]; -
+var searchValue = (value) => { + return arr.filter((item) => { + return item.indexOf(value) > -1; + }); +}; - +console.log(searchValue("script")); +``` -## Q. What would be the output of following code? +## Q. Write a program that prints the numbers from 1 to 15. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”? -```javascript -(function () { - var objA = new Object({ foo: "foo" }); - var objB = new Object({ foo: "foo" }); - console.log(objA == objB); - console.log(objA === objB); -})(); +**Example:** + +```js +Input: 15 +Output: +1 +2 +Fizz +4 +Buzz +Fizz +7 +8 +Fizz +Buzz +11 +Fizz +13 +14 +FizzBuzz ```
Answer -_Answer:_ false false - -
+**Solution - 01:** - +```javascript +for (var i = 1; i <= 15; i++) { + if (i % 15 == 0) console.log("FizzBuzz"); + else if (i % 3 == 0) console.log("Fizz"); + else if (i % 5 == 0) console.log("Buzz"); + else console.log(i); +} +``` -## Q. What would be the output of following code? +**Solution - 02:** ```javascript -(function () { - var objA = Object.create({ - foo: "foo", - }); - var objB = Object.create({ - foo: "foo", - }); - console.log(objA == objB); - console.log(objA === objB); -})(); +for (var i = 1; i <= 15; i++) { + var f = i % 3 == 0, + b = i % 5 == 0; + console.log(f ? (b ? "FizzBuzz" : "Fizz") : b ? "Buzz" : i); +} ``` -
Answer - -_Answer:_ 2) false false -
-## Q. What would be the output of following code? +## Q. What will be the output of the following code? ```javascript -(function () { - var objA = Object.create({ - foo: "foo", - }); - var objB = Object.create(objA); - console.log(objA == objB); - console.log(objA === objB); -})(); +var output = (function (x) { + delete x; + return x; +})(0); + +console.log(output); ```
Answer -_Answer:_ 2) false false +The code above will output `0` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **local variable**. `delete` operator doesn't affect local variables.
@@ -2232,22 +2501,21 @@ _Answer:_ 2) false false ↥ back to top -## Q. What would be the output of following code? +## Q. What will be the output of the following code? ```javascript -(function () { - var objA = Object.create({ - foo: "foo", - }); - var objB = Object.create(objA); - console.log(objA.toString() == objB.toString()); - console.log(objA.toString() === objB.toString()); +var x = 1; +var output = (function () { + delete x; + return x; })(); + +console.log(output); ```
Answer -_Answer:_ true true +The code above will output `1` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **global variable** of type `number`.
@@ -2255,24 +2523,21 @@ _Answer:_ true true ↥ back to top -## Q. What would be the output of following code? +## Q. What will be the output of the following code? ```javascript -(function () { - var objA = Object.create({ - foo: "foo", - }); - var objB = objA; - console.log(objA == objB); - console.log(objA === objB); - console.log(objA.toString() == objB.toString()); - console.log(objA.toString() === objB.toString()); +var x = { foo: 1 }; +var output = (function () { + delete x.foo; + return x.foo; })(); + +console.log(output); ```
Answer -_Answer:_ true true true true +The code above will output `undefined` as output. `delete` operator is used to delete a property from an object. Here `x` is an object which has foo as a property and from a self-invoking function, we are deleting the `foo` property of object `x` and after deletion, we are trying to reference deleted property `foo` which result `undefined`.
@@ -2280,23 +2545,22 @@ _Answer:_ true true true true ↥ back to top -## Q. What would be the output of following code? +## Q. What will be the output of the following code? ```javascript -(function () { - var objA = Object.create({ - foo: "foo", - }); - var objB = objA; - objB.foo = "bar"; - console.log(objA.foo); - console.log(objB.foo); -})(); +var Employee = { + company: "xyz", +}; +var emp1 = Object.create(Employee); +delete emp1.company; +console.log(emp1.company); ```
Answer -_Answer:_ bar bar +The code above will output `xyz` as output. Here `emp1` object got company as **prototype** property. delete operator doesn't delete prototype property. + +`emp1` object doesn't have **company** as its own property. you can test it `console.log(emp1.hasOwnProperty('company')); //output : false` However, we can delete company property directly from `Employee` object using `delete Employee.company` or we can also delete from `emp1` object using `__proto__` property `delete emp1.__proto__.company`.
@@ -2304,25 +2568,19 @@ _Answer:_ bar bar ↥ back to top -## Q. What would be the output of following code? +## Q. What will be the output of the following code? ```javascript -(function () { - var objA = Object.create({ - foo: "foo", - }); - var objB = objA; - objB.foo = "bar"; - - delete objA.foo; - console.log(objA.foo); - console.log(objB.foo); -})(); +var trees = ["xyz", "xxxx", "test", "ryan", "apple"]; +delete trees[3]; +console.log(trees.length); ```
Answer -_Answer:_ foo foo +The code above will output `5` as output. When we used `delete` operator for deleting an array element then, the array length is not affected by this. This holds even if you deleted all elements of an array using `delete` operator. + +So when delete operator removes an array element that deleted element is no longer present in the array. In place of value at deleted index `undefined x 1` in **chrome** and `undefined` is placed at the index. If you do `console.log(trees)` output `["xyz", "xxxx", "test", undefined × 1, "apple"]` in Chrome and in Firefox `["xyz", "xxxx", "test", undefined, "apple"]`.
@@ -2330,25 +2588,26 @@ _Answer:_ foo foo ↥ back to top -## Q. What would be the output of following code? +## Q. What will be the output of the following code? ```javascript -(function () { - var objA = { - foo: "foo", - }; - var objB = objA; - objB.foo = "bar"; - - delete objA.foo; - console.log(objA.foo); - console.log(objB.foo); -})(); +var bar = true; +console.log(bar + 0); +console.log(bar + "xyz"); +console.log(bar + true); +console.log(bar + false); ```
Answer -_Answer:_ undefined undefined +The code above will output `1, "truexyz", 2, 1` as output. Here's a general guideline for the plus operator: + +- Number + Number -> Addition +- Boolean + Number -> Addition +- Boolean + Boolean -> Addition +- Number + String -> Concatenation +- String + Boolean -> Concatenation +- String + String -> Concatenation
@@ -2356,64 +2615,73 @@ _Answer:_ undefined undefined ↥ back to top -## Q. What would be the output of following code? +## Q. What will be the output of the following code? ```javascript -(function () { - var array = new Array("100"); - console.log(array); - console.log(array.length); -})(); +var z = 1, + y = (z = typeof y); +console.log(y); ```
Answer -_Answer:_ 3) ["100"] 1 +The code above will print string `"undefined"` as output. According to associativity rule operator with the same precedence are processed based on their associativity property of operator. Here associativity of the assignment operator is `Right to Left` so first `typeof y` will evaluate first which is string `"undefined"` and assigned to `z` and then `y` would be assigned the value of z. The overall sequence will look like that: -
+```javascript +var z; +z = 1; +var y; +z = typeof y; +y = z; +``` - +
-## Q. What would be the output of following code? +## Q. What will be the output of the following code? ```javascript -(function () { - var array1 = []; - var array2 = new Array(100); - var array3 = new Array(["1", 2, "3", 4, 5.6]); - console.log(array1); - console.log(array2); - console.log(array3); - console.log(array3.length); -})(); +// NFE (Named Function Expression) +var foo = function bar() { + return 12; +}; +typeof bar(); ```
Answer -_Answer:_ [] [] [Array[5]] 1 +The output will be `Reference Error`. To fix the bug we can try to rewrite the code a little bit: -
+**Sample 1:** - +```javascript +var bar = function () { + return 12; +}; +typeof bar(); +``` -## Q. What would be the output of following code? +or + +**Sample 2:** ```javascript -(function () { - var array = new Array("a", "b", "c", "d", "e"); - array[10] = "f"; - delete array[10]; - console.log(array.length); -})(); +function bar() { + return 12; +} +typeof bar(); ``` -
Answer +The function definition can have only one reference variable as a function name, In **sample 1** `bar` is reference variable which is pointing to `anonymous function` and in **sample 2** we have function statement and `bar` is the function name. -_Answer:_ 11 +```javascript +var foo = function bar() { + // foo is visible here + // bar is visible here + console.log(typeof bar()); // Works here :) +}; +// foo is visible here +// bar is undefined here +```
@@ -2421,20 +2689,28 @@ _Answer:_ 11 ↥ back to top -## Q. What would be the output of following code? +## Q. What is the output of the following? ```javascript -(function () { - var animal = ["cow", "horse"]; - animal.push("cat"); - animal.push("dog", "rat", "goat"); - console.log(animal.length); +bar(); +(function abc() { + console.log("something"); })(); +function bar() { + console.log("bar got called"); +} ```
Answer -_Answer:_ 6 +The output will be : + +```js +bar got called +something +``` + +Since the function is called first and defined during parse time the JS engine will try to find any possible parse time definitions and start the execution loop which will mean function is called first even if the definition is post another function.
@@ -2442,20 +2718,36 @@ _Answer:_ 6 ↥ back to top -## Q. What would be the output of following code? +## Q. What will be the output of the following code? ```javascript +var salary = "1000$"; + (function () { - var animal = ["cow", "horse"]; - animal.push("cat"); - animal.unshift("dog", "rat", "goat"); - console.log(animal); + console.log("Original salary was " + salary); + + var salary = "5000$"; + + console.log("My New Salary " + salary); })(); ```
Answer -_Answer:_ [ 'dog', 'rat', 'goat', 'cow', 'horse', 'cat' ] +The code above will output: `undefined, 5000$` because of hoisting. In the code presented above, you might be expecting `salary` to retain it values from outer scope until the point that `salary` was re-declared in the inner scope. But due to `hoisting` salary value was `undefined` instead. To understand it better have a look of the following code, here `salary` variable is hoisted and declared at the top in function scope. When we print its value using `console.log` the result is `undefined`. Afterwards the variable is redeclared and the new value `"5000$"` is assigned to it. + +```javascript +var salary = "1000$"; + +(function () { + var salary = undefined; + console.log("Original salary was " + salary); + + salary = "5000$"; + + console.log("My New Salary " + salary); +})(); +```
@@ -2463,21 +2755,36 @@ _Answer:_ [ 'dog', 'rat', 'goat', 'cow', 'horse', 'cat' ] ↥ back to top -## Q. What would be the output of following code? +## Q. What would be the output of the following code? ```javascript -(function () { - var array = [1, 2, 3, 4, 5]; - console.log(array.indexOf(2)); - console.log([{ name: "John" }, { name: "John" }].indexOf({ name: "John" })); - console.log([[1], [2], [3], [4]].indexOf([3])); - console.log("abcdefgh".indexOf("e")); -})(); +function User(name) { + this.name = name || "JsGeeks"; +} + +var person = (new User("xyz")["location"] = "USA"); +console.log(person); ```
Answer -_Answer:_ 1) 1 -1 -1 4 +The output of above code would be `"USA"`. Here `new User("xyz")` creates a brand new object and created property `location` on that and `USA` has been assigned to object property location and that has been referenced by the person. + +Let say `new User("xyz")` created a object called `foo`. The value `"USA"` will be assigned to `foo["location"]`, but according to [ECMAScript Specification](http://www.ecma-international.org/ecma-262/6.0/#sec-assignment-operators-runtime-semantics-evaluation) , pt 12.14.4 the assignment will itself return the rightmost value: in our case it's `"USA"`. +Then it will be assigned to person. + +To better understand What is going on here, try to execute this code in console, line by line: + +```javascript +function User(name) { + this.name = name || "JS"; +} + +var person; +var foo = new User("xyz"); +foo["location"] = "USA"; +// the console will show you that the result of this is "USA" +```
@@ -2488,17 +2795,16 @@ _Answer:_ 1) 1 -1 -1 4 ## Q. What would be the output of following code? ```javascript -(function () { - var array = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6]; - console.log(array.indexOf(2)); - console.log(array.indexOf(2, 3)); - console.log(array.indexOf(2, 10)); -})(); +var strA = "hi there"; +var strB = strA; +strB = "bye there!"; +console.log(strA); ```
Answer -_Answer:_ 1 6 -1 +The output will `'hi there'` because we're dealing with strings here. Strings are +passed by value, that is, copied.
@@ -2509,65 +2815,18 @@ _Answer:_ 1 6 -1 ## Q. What would be the output of following code? ```javascript -(function () { - var numbers = [2, 3, 4, 8, 9, 11, 13, 12, 16]; - var even = numbers.filter(function (element, index) { - return element % 2 === 0; - }); - console.log(even); - - var containsDivisibleby3 = numbers.some(function (element, index) { - return element % 3 === 0; - }); - - console.log(containsDivisibleby3); -})(); +var objA = { prop1: 42 }; +var objB = objA; +objB.prop1 = 90; +console.log(objA); ``` -1. [ 2, 4, 8, 12, 16 ] [ 0, 3, 0, 0, 9, 0, 12] -2. [ 2, 4, 8, 12, 16 ] [ 3, 9, 12] -3. [ 2, 4, 8, 12, 16 ] true -4. [ 2, 4, 8, 12, 16 ] false - -_Answer:_ 3) [ 2, 4, 8, 12, 16 ] true - -## Q. What would be the output of following code? +
Answer -```javascript -(function () { - var containers = [2, 0, false, "", "12", true]; - var containers = containers.filter(Boolean); - console.log(containers); - var containers = containers.filter(Number); - console.log(containers); - var containers = containers.filter(String); - console.log(containers); - var containers = containers.filter(Object); - console.log(containers); -})(); -``` +The output will `{prop1: 90}` because we're dealing with objects here. Objects are +passed by reference, that is, `objA` and `objB` point to the same object in memory. -1. [ 2, '12', true ] - [ 2, '12', true ] - [ 2, '12', true ] - [ 2, '12', true ] -2. [false, true] - [ 2 ] - ['12'] - [ ] -3. [2,0,false,"", '12', true] - [2,0,false,"", '12', true] - [2,0,false,"", '12', true] - [2,0,false,"", '12', true] -4. [ 2, '12', true ] - [ 2, '12', true, false ] - [ 2, '12', true,false ] - [ 2, '12', true,false] - -_Answer:_ 1) [ 2, '12', true ] -[ 2, '12', true ] -[ 2, '12', true ] -[ 2, '12', true ] +
↥ back to top @@ -2576,60 +2835,23 @@ _Answer:_ 1) [ 2, '12', true ] ## Q. What would be the output of following code? ```javascript -(function () { - var list = ["foo", "bar", "john", "ritz"]; - console.log(list.slice(1)); - console.log(list.slice(1, 3)); - console.log(list.slice()); - console.log(list.slice(2, 2)); - console.log(list); -})(); +var objA = { prop1: 42 }; +var objB = objA; +objB = {}; +console.log(objA); ``` -1. [ 'bar', 'john', 'ritz' ] - [ 'bar', 'john' ] - [ 'foo', 'bar', 'john', 'ritz' ] - [] - [ 'foo', 'bar', 'john', 'ritz' ] -2. [ 'bar', 'john', 'ritz' ] - [ 'bar', 'john','ritz ] - [ 'foo', 'bar', 'john', 'ritz' ] - [] - [ 'foo', 'bar', 'john', 'ritz' ] -3. [ 'john', 'ritz' ] - [ 'bar', 'john' ] - [ 'foo', 'bar', 'john', 'ritz' ] - [] - [ 'foo', 'bar', 'john', 'ritz' ] -4. [ 'foo' ] - [ 'bar', 'john' ] - [ 'foo', 'bar', 'john', 'ritz' ] - [] - [ 'foo', 'bar', 'john', 'ritz' ] - -_Answer:_ 1) [ 'bar', 'john', 'ritz' ] -[ 'bar', 'john' ] -[ 'foo', 'bar', 'john', 'ritz' ] -[] -[ 'foo', 'bar', 'john', 'ritz' ] +
Answer -## Q. What would be the output of following code? +The output will `{prop1: 42}`. -```javascript -(function () { - var list = ["foo", "bar", "john"]; - console.log(list.splice(1)); - console.log(list.splice(1, 2)); - console.log(list); -})(); -``` +When we assign `objA` to `objB`, the `objB` variable will point +to the same object as the `objB` variable. -1. [ 'bar', 'john' ] [] [ 'foo' ] -2. [ 'bar', 'john' ] [] [ 'bar', 'john' ] -3. [ 'bar', 'john' ] [ 'bar', 'john' ] [ 'bar', 'john' ] -4. [ 'bar', 'john' ] [] [] +However, when we reassign `objB` to an empty object, we simply change where `objB` variable references to. +This doesn\'t affect where `objA` variable references to. -_Answer:_ 1. [ 'bar', 'john' ] [] [ 'foo' ] +
↥ back to top @@ -2638,44 +2860,21 @@ _Answer:_ 1. [ 'bar', 'john' ] [] [ 'foo' ] ## Q. What would be the output of following code? ```javascript -(function () { - var arrayNumb = [2, 8, 15, 16, 23, 42]; - arrayNumb.sort(); - console.log(arrayNumb); -})(); +var arrA = [0, 1, 2, 3, 4, 5]; +var arrB = arrA; +arrB[0] = 42; +console.log(arrA); ``` -1. [2, 8, 15, 16, 23, 42] -2. [42, 23, 26, 15, 8, 2] -3. [ 15, 16, 2, 23, 42, 8 ] -4. [ 2, 8, 15, 16, 23, 42 ] - -_Answer:_ 3. [ 15, 16, 2, 23, 42, 8 ] - -## Q. What would be the output of following code? - -```javascript -function funcA() { - console.log("funcA ", this); - (function innerFuncA1() { - console.log("innerFunc1", this); - (function innerFunA11() { - console.log("innerFunA11", this); - })(); - })(); -} +
Answer -console.log(funcA()); -``` +The output will be `[42,1,2,3,4,5]`. -1. funcA Window {...} - innerFunc1 Window {...} - innerFunA11 Window {...} -2. undefined -3. Type Error -4. ReferenceError: this is not defined +Arrays are object in JavaScript and they are passed and assigned by reference. This is why +both `arrA` and `arrB` point to the same array `[0,1,2,3,4,5]`. That's why changing the first +element of the `arrB` will also modify `arrA`: it's the same array in the memory. -_Answer:_ 1) +
↥ back to top @@ -2684,42 +2883,20 @@ _Answer:_ 1) ## Q. What would be the output of following code? ```javascript -var obj = { - message: "Hello", - innerMessage: !(function () { - console.log(this.message); - })(), -}; - -console.log(obj.innerMessage); +var arrA = [0, 1, 2, 3, 4, 5]; +var arrB = arrA.slice(); +arrB[0] = 42; +console.log(arrA); ``` -1. ReferenceError: this.message is not defined -2. undefined -3. Type Error -4. undefined true - -_Answer:_ 4) undefined true - -## Q. What would be the output of following code? - -```javascript -var obj = { - message: "Hello", - innerMessage: function () { - return this.message; - }, -}; +
Answer -console.log(obj.innerMessage()); -``` +The output will be `[0,1,2,3,4,5]`. -1. Hello -2. undefined -3. Type Error -4. ReferenceError: this.message is not defined +The `slice` function copies all the elements of the array returning the new array. That's why +`arrA` and `arrB` reference two completely different arrays. -_Answer:_ 1) Hello +
↥ back to top @@ -2728,45 +2905,26 @@ _Answer:_ 1) Hello ## Q. What would be the output of following code? ```javascript -var obj = { - message: "Hello", - innerMessage: function () { - (function () { - console.log(this.message); - })(); - }, -}; -console.log(obj.innerMessage()); +var arrA = [ + { prop1: "value of array A!!" }, + { someProp: "also value of array A!" }, + 3, + 4, + 5, +]; +var arrB = arrA; +arrB[0].prop1 = 42; +console.log(arrA); ``` -1. Type Error -2. Hello -3. undefined -4. ReferenceError: this.message is not defined - -_Answer:_ 3) undefined - -## Q. What would be the output of following code? +
Answer -```javascript -var obj = { - message: "Hello", - innerMessage: function () { - var self = this; - (function () { - console.log(self.message); - })(); - }, -}; -console.log(obj.innerMessage()); -``` +The output will be `[{prop1: 42}, {someProp: "also value of array A!"}, 3,4,5]`. -1. Type Error -2. 'Hello' -3. undefined -4. ReferenceError: self.message is not defined +Arrays are object in JS, so both varaibles arrA and arrB point to the same array. Changing +`arrB[0]` is the same as changing `arrA[0]` -_Answer:_ 2) 'Hello' +
↥ back to top @@ -2775,77 +2933,75 @@ _Answer:_ 2) 'Hello' ## Q. What would be the output of following code? ```javascript -function myFunc() { - console.log(this.message); -} -myFunc.message = "Hi John"; - -console.log(myFunc()); +var arrA = [ + { prop1: "value of array A!!" }, + { someProp: "also value of array A!" }, + 3, + 4, + 5, +]; +var arrB = arrA.slice(); +arrB[0].prop1 = 42; +arrB[3] = 20; +console.log(arrA); ``` -1. Type Error -2. 'Hi John' -3. undefined -4. ReferenceError: this.message is not defined +
Answer -_Answer:_ 3) undefined +The output will be `[{prop1: 42}, {someProp: "also value of array A!"}, 3,4,5]`. -## Q. What would be the output of following code? +The `slice` function copies all the elements of the array returning the new array. However, +it doesn't do deep copying. Instead it does shallow copying. You can imagine slice implemented like this: ```javascript -function myFunc() { - console.log(myFunc.message); +function slice(arr) { + var result = []; + for (i = 0; i < arr.length; i++) { + result.push(arr[i]); + } + return result; } -myFunc.message = "Hi John"; - -console.log(myFunc()); ``` -1. Type Error -2. 'Hi John' -3. undefined -4. ReferenceError: this.message is not defined +Look at the line with `result.push(arr[i])`. If `arr[i]` happens to be a number or string, +it will be passed by value, in other words, copied. If `arr[i]` is an object, it will be passed by reference. + +In case of our array `arr[0]` is an object `{prop1: "value of array A!!"}`. Only the reference +to this object will be copied. This effectively means that arrays arrA and arrB share first +two elements. + +This is why changing the property of `arrB[0]` in `arrB` will also change the `arrA[0]`. -_Answer:_ 2) 'Hi John' +
-## Q. What would be the output of following code? +## Q. console.log(employeeId); -```javascript -function myFunc() { - myFunc.message = "Hi John"; - console.log(myFunc.message); -} -console.log(myFunc()); -``` +
Answer -1. Type Error -2. 'Hi John' -3. undefined -4. ReferenceError: this.message is not defined +_Answer:_ ReferenceError: employeeId is not defined + +
-_Answer:_ 2) 'Hi John' + ## Q. What would be the output of following code? ```javascript -function myFunc(param1, param2) { - console.log(myFunc.length); -} -console.log(myFunc()); -console.log(myFunc("a", "b")); -console.log(myFunc("a", "b", "c", "d")); +console.log(employeeId); +var employeeId = "19000"; ``` -1. 2 2 2 -2. 0 2 4 -3. undefined -4. ReferenceError +
Answer + +_Answer:_ undefined -_Answer:_ a) 2 2 2 +
↥ back to top @@ -2854,48 +3010,43 @@ _Answer:_ a) 2 2 2 ## Q. What would be the output of following code? ```javascript -function myFunc() { - console.log(arguments.length); -} -console.log(myFunc()); -console.log(myFunc("a", "b")); -console.log(myFunc("a", "b", "c", "d")); +var employeeId = "1234abe"; +(function () { + console.log(employeeId); + var employeeId = "122345"; +})(); ``` -1. 2 2 2 -2. 0 2 4 -3. undefined -4. ReferenceError +
Answer + +_Answer:_ 2) undefined + +
-_Answer:_ 2) 0 2 4 + ## Q. What would be the output of following code? ```javascript -function Person(name, age) { - this.name = name || "John"; - this.age = age || 24; - this.displayName = function () { - console.log(this.name); - }; -} +var employeeId = "1234abe"; +(function () { + console.log(employeeId); + var employeeId = "122345"; + (function () { + var employeeId = "abc1234"; + })(); +})(); +``` -Person.name = "John"; -Person.displayName = function () { - console.log(this.name); -}; +
Answer -var person1 = new Person("John"); -person1.displayName(); -Person.displayName(); +```js +undefined ``` -1. John Person -2. John John -3. John undefined -4. John John - -_Answer:_ 1) John Person +
↥ back to top @@ -2904,89 +3055,67 @@ _Answer:_ 1) John Person ## Q. What would be the output of following code? ```javascript -function passWordMngr() { - var password = "12345678"; - this.userName = "John"; - return { - pwd: password, +(function () { + console.log(typeof displayFunc); + var displayFunc = function () { + console.log("Hi I am inside displayFunc"); }; -} -// Block End -var userInfo = passWordMngr(); -console.log(userInfo.pwd); -console.log(userInfo.userName); +})(); ``` -1. 12345678 Window -2. 12345678 John -3. 12345678 undefined -4. undefined undefined +
Answer + +_Answer:_ undefined + +
-_Answer:_ 3) 12345678 undefined + ## Q. What would be the output of following code? ```javascript -var employeeId = "aq123"; -function Employee() { - this.employeeId = "bq1uy"; +var employeeId = "abc123"; +function foo() { + employeeId = "123bcd"; + return; } -console.log(Employee.employeeId); +foo(); +console.log(employeeId); ``` -1. Reference Error -2. aq123 -3. bq1uy -4. undefined +
Answer + +_Answer:_ '123bcd' -_Answer:_ 4) undefined +
+ ## Q. What would be the output of following code? ```javascript -var employeeId = "aq123"; +var employeeId = "abc123"; -function Employee() { - this.employeeId = "bq1uy"; +function foo() { + employeeId = "123bcd"; + return; + + function employeeId() {} } -console.log(new Employee().employeeId); -Employee.prototype.employeeId = "kj182"; -Employee.prototype.JobId = "1BJKSJ"; -console.log(new Employee().JobId); -console.log(new Employee().employeeId); +foo(); +console.log(employeeId); ``` -1. bq1uy 1BJKSJ bq1uy undefined -2. bq1uy 1BJKSJ bq1uy -3. bq1uy 1BJKSJ kj182 -4. undefined 1BJKSJ kj182 - -_Answer:_ 2) bq1uy 1BJKSJ bq1uy - -## Q. What would be the output of following code? - -```javascript -var employeeId = "aq123"; -(function Employee() { - try { - throw "foo123"; - } catch (employeeId) { - console.log(employeeId); - } - console.log(employeeId); -})(); -``` +
Answer -1. foo123 aq123 -2. foo123 foo123 -3. aq123 aq123 -4. foo123 undefined +_Answer:_ 'abc123' -_Answer:_ 1) foo123 aq123 +
↥ back to top @@ -2995,52 +3124,24 @@ _Answer:_ 1) foo123 aq123 ## Q. What would be the output of following code? ```javascript -(function () { - var greet = "Hello World"; - var toGreet = [].filter.call(greet, function (element, index) { - return index > 5; - }); - console.log(toGreet); -})(); -``` - -1. Hello World -2. undefined -3. World -4. [ 'W', 'o', 'r', 'l', 'd' ] - -_Answer:_ 4) [ 'W', 'o', 'r', 'l', 'd' ] +var employeeId = "abc123"; -## Q. What would be the output of following code? +function foo() { + employeeId(); + return; -```javascript -(function () { - var fooAccount = { - name: "John", - amount: 4000, - deductAmount: function (amount) { - this.amount -= amount; - return "Total amount left in account: " + this.amount; - }, - }; - var barAccount = { - name: "John", - amount: 6000, - }; - var withdrawAmountBy = function (totalAmount) { - return fooAccount.deductAmount.bind(barAccount, totalAmount); - }; - console.log(withdrawAmountBy(400)()); - console.log(withdrawAmountBy(300)()); -})(); + function employeeId() { + console.log(typeof employeeId); + } +} +foo(); ``` -1. Total amount left in account: 5600 Total amount left in account: 5300 -2. undefined undefined -3. Total amount left in account: 3600 Total amount left in account: 3300 -4. Total amount left in account: 5600 Total amount left in account: 5600 +
Answer + +_Answer:_ 'function' -_Answer:_ 1) Total amount left in account: 5600 Total amount left in account: 5300 +
↥ back to top @@ -3049,34 +3150,23 @@ _Answer:_ 1) Total amount left in account: 5600 Total amount left in account: 53 ## Q. What would be the output of following code? ```javascript -(function () { - var fooAccount = { - name: "John", - amount: 4000, - deductAmount: function (amount) { - this.amount -= amount; - return this.amount; - }, - }; - var barAccount = { - name: "John", - amount: 6000, - }; - var withdrawAmountBy = function (totalAmount) { - return fooAccount.deductAmount.apply(barAccount, [totalAmount]); - }; - console.log(withdrawAmountBy(400)); - console.log(withdrawAmountBy(300)); - console.log(withdrawAmountBy(200)); -})(); +function foo() { + employeeId(); + var product = "Car"; + return; + + function employeeId() { + console.log(product); + } +} +foo(); ``` -1. 5600 5300 5100 -2. 3600 3300 3100 -3. 5600 3300 5100 -4. undefined undefined undefined +
Answer + +_Answer:_ 1) undefined -_Answer:_ 1) 5600 5300 5100 +
↥ back to top @@ -3085,34 +3175,25 @@ _Answer:_ 1) 5600 5300 5100 ## Q. What would be the output of following code? ```javascript -(function () { - var fooAccount = { - name: "John", - amount: 6000, - deductAmount: function (amount) { - this.amount -= amount; - return this.amount; - }, - }; - var barAccount = { - name: "John", - amount: 4000, - }; - var withdrawAmountBy = function (totalAmount) { - return fooAccount.deductAmount.call(barAccount, totalAmount); - }; - console.log(withdrawAmountBy(400)); - console.log(withdrawAmountBy(300)); - console.log(withdrawAmountBy(200)); +(function foo() { + bar(); + + function bar() { + abc(); + console.log(typeof abc); + } + + function abc() { + console.log(typeof bar); + } })(); ``` -1. 5600 5300 5100 -2. 3600 3300 3100 -3. 5600 3300 5100 -4. undefined undefined undefined +
Answer + +_Answer:_ function function -_Answer:_ 2) 3600 3300 3100 +
↥ back to top @@ -3121,43 +3202,29 @@ _Answer:_ 2) 3600 3300 3100 ## Q. What would be the output of following code? ```javascript -(function greetNewCustomer() { - console.log("Hello " + this.name); -}.bind({ - name: "John", -})()); -``` - -1. Hello John -2. Reference Error -3. Window -4. undefined - -_Answer:_ 1) Hello John - -## Q. What would be the output of following code? +(function () { + "use strict"; -```javascript -function getDataFromServer(apiUrl) { - var name = "John"; - return { - then: function (fn) { - fn(name); - }, + var person = { + name: "John", }; -} + person.salary = "10000$"; + person["country"] = "USA"; -getDataFromServer("www.google.com").then(function (name) { - console.log(name); -}); + Object.defineProperty(person, "phoneNo", { + value: "8888888888", + enumerable: true, + }); + + console.log(Object.keys(person)); +})(); ``` -1. John -2. undefined -3. Reference Error -4. fn is not defined +
Answer + +_Answer:_ ["name", "salary", "country", "phoneNo"] -_Answer:_ 1) John +
↥ back to top @@ -3167,47 +3234,28 @@ _Answer:_ 1) John ```javascript (function () { - var arrayNumb = [2, 8, 15, 16, 23, 42]; - Array.prototype.sort = function (a, b) { - return a - b; + "use strict"; + + var person = { + name: "John", }; - arrayNumb.sort(); - console.log(arrayNumb); -})(); + person.salary = "10000$"; + person["country"] = "USA"; -(function () { - var numberArray = [2, 8, 15, 16, 23, 42]; - numberArray.sort(function (a, b) { - if (a == b) { - return 0; - } else { - return a < b ? -1 : 1; - } + Object.defineProperty(person, "phoneNo", { + value: "8888888888", + enumerable: false, }); - console.log(numberArray); -})(); -(function () { - var numberArray = [2, 8, 15, 16, 23, 42]; - numberArray.sort(function (a, b) { - return a - b; - }); - console.log(numberArray); + console.log(Object.keys(person)); })(); ``` -1. [ 2, 8, 15, 16, 23, 42 ] - [ 2, 8, 15, 16, 23, 42 ] - [ 2, 8, 15, 16, 23, 42 ] -2. undefined undefined undefined -3. [42, 23, 16, 15, 8, 2] - [42, 23, 16, 15, 8, 2] - [42, 23, 16, 15, 8, 2] -4. Reference Error +
Answer -_Answer:_ 1) [ 2, 8, 15, 16, 23, 42 ] -[ 2, 8, 15, 16, 23, 42 ] -[ 2, 8, 15, 16, 23, 42 ] +_Answer:_ ["name", "salary", "country"] + +
↥ back to top @@ -3217,41 +3265,24 @@ _Answer:_ 1) [ 2, 8, 15, 16, 23, 42 ] ```javascript (function () { - function sayHello() { - var name = "Hi John"; - return; - { - fullName: name; - } - } - console.log(sayHello().fullName); + var objA = { + foo: "foo", + bar: "bar", + }; + var objB = { + foo: "foo", + bar: "bar", + }; + console.log(objA == objB); + console.log(objA === objB); })(); ``` -1. Hi John -2. undefined -3. Reference Error -4. Uncaught TypeError: Cannot read property 'fullName' of undefined - -_Answer:_ 4) Uncaught TypeError: Cannot read property 'fullName' of undefined - -## Q. What would be the output of following code? - -```javascript -function getNumber() { - return 2, 4, 5; -} - -var numb = getNumber(); -console.log(numb); -``` +
Answer -1. 5 -2. undefined -3. 2 -4. (2,4,5) +_Answer:_ 2) false false -_Answer:_ 1) 5 +
↥ back to top @@ -3260,45 +3291,19 @@ _Answer:_ 1) 5 ## Q. What would be the output of following code? ```javascript -function getNumber() { - return; -} - -var numb = getNumber(); -console.log(numb); +(function () { + var objA = new Object({ foo: "foo" }); + var objB = new Object({ foo: "foo" }); + console.log(objA == objB); + console.log(objA === objB); +})(); ``` -1. null -2. undefined -3. "" -4. 0 - -_Answer:_ 2) undefined - -## Q. What would be the output of following code? - -```javascript -function mul(x) { - return function (y) { - return [ - x * y, - function (z) { - return x * y + z; - }, - ]; - }; -} - -console.log(mul(2)(3)[0]); -console.log(mul(2)(3)[1](4)); -``` +
Answer -1. 6, 10 -2. undefined undefined -3. Reference Error -4. 10, 6 +_Answer:_ false false -_Answer:_ 1) 6, 10 +
↥ back to top @@ -3307,1815 +3312,1642 @@ _Answer:_ 1) 6, 10 ## Q. What would be the output of following code? ```javascript -function mul(x) { - return function (y) { - return { - result: x * y, - sum: function (z) { - return x * y + z; - }, - }; - }; -} -console.log(mul(2)(3).result); -console.log(mul(2)(3).sum(4)); +(function () { + var objA = Object.create({ + foo: "foo", + }); + var objB = Object.create({ + foo: "foo", + }); + console.log(objA == objB); + console.log(objA === objB); +})(); ``` -1. 6, 10 -2. undefined undefined -3. Reference Error -4. 10, 6 +
Answer + +_Answer:_ 2) false false + +
-_Answer:_ 1) 6, 10 + ## Q. What would be the output of following code? ```javascript -function mul(x) { - return function (y) { - return function (z) { - return function (w) { - return function (p) { - return x * y * z * w * p; - }; - }; - }; - }; -} -console.log(mul(2)(3)(4)(5)(6)); +(function () { + var objA = Object.create({ + foo: "foo", + }); + var objB = Object.create(objA); + console.log(objA == objB); + console.log(objA === objB); +})(); ``` -1. 720 -2. undefined -3. Reference Error -4. Type Error +
Answer + +_Answer:_ 2) false false -_Answer:_ 1) 720 +
-## Q. What is the value of `foo`? +## Q. What would be the output of following code? ```javascript -var foo = 10 + "20"; +(function () { + var objA = Object.create({ + foo: "foo", + }); + var objB = Object.create(objA); + console.log(objA.toString() == objB.toString()); + console.log(objA.toString() === objB.toString()); +})(); ``` -_Answer:_ `'1020'`, because of type coercion from Number to String +
Answer -## Q. How would you make this work? +_Answer:_ true true -```javascript -add(2, 5); // 7 -add(2)(5); // 7 -``` +
-_Answer:_ A general solution for any number of parameters + -```javascript -"use strict"; +## Q. What would be the output of following code? -let sum = (arr) => arr.reduce((a, b) => a + b); -let addGenerator = (numArgs, prevArgs) => { - return function () { - let totalArgs = prevArgs.concat(Array.from(arguments)); - if (totalArgs.length === numArgs) { - return sum(totalArgs); - } - return addGenerator(numArgs, totalArgs); - }; -}; +```javascript +(function () { + var objA = Object.create({ + foo: "foo", + }); + var objB = objA; + console.log(objA == objB); + console.log(objA === objB); + console.log(objA.toString() == objB.toString()); + console.log(objA.toString() === objB.toString()); +})(); +``` -let add = addGenerator(2, []); +
Answer -add(2, 5); // 7 -add(2)(5); // 7 -add()(2, 5); // 7 -add()(2)(5); // 7 -add()()(2)(5); // 7 -``` +_Answer:_ true true true true + +
-## Q. What value is returned from the following statement? +## Q. What would be the output of following code? ```javascript -"i'm a lasagna hog".split("").reverse().join(""); +(function () { + var objA = Object.create({ + foo: "foo", + }); + var objB = objA; + objB.foo = "bar"; + console.log(objA.foo); + console.log(objB.foo); +})(); ``` -_Answer:_ It's actually a reverse method for a string - `'goh angasal a m\'i'` +
Answer -## Q. What is the value of `window.foo`? +_Answer:_ bar bar -```javascript -window.foo || (window.foo = "bar"); -``` +
-_Answer:_ Always `'bar'` + -## Q. What is the outcome of the two alerts below? +## Q. What would be the output of following code? ```javascript -var foo = "Hello"; (function () { - var bar = " World"; - alert(foo + bar); + var objA = Object.create({ + foo: "foo", + }); + var objB = objA; + objB.foo = "bar"; + + delete objA.foo; + console.log(objA.foo); + console.log(objB.foo); })(); -alert(foo + bar); ``` -_Answer:_ +
Answer -- First: `Hello World` -- Second: Throws an exception, `ReferenceError: bar is not defined` +_Answer:_ foo foo + +
-## Q. What is the value of `foo.length`? +## Q. What would be the output of following code? ```javascript -var foo = []; -foo.push(1); -foo.push(2); -``` - -_Answer:_ `.push` is mutable - `2` - -## Q. What is the value of `foo.x`? +(function () { + var objA = { + foo: "foo", + }; + var objB = objA; + objB.foo = "bar"; -```javascript -var foo = { n: 1 }; -var bar = foo; -foo.x = foo = { n: 2 }; + delete objA.foo; + console.log(objA.foo); + console.log(objB.foo); +})(); ``` -_Answer:_ `undefined`. Rather, `bar.x` is `{n: 2}`. +
Answer -`foo.x = foo = {n: 2}` is the same as `foo.x = (foo = {n: 2})`. It is because -a left term is first referenced and then a right term is evaluated when an -assignment is performed in JavaScript. When `foo.x` is referenced, it refers -to an original object, `{n: 1}`. So, when the result of the right term, `{n: 2}`, is evaluated, it will assigned to the original object, which is at the -moment referenced by `bar`. +_Answer:_ undefined undefined + +
-## Q. What does the following code print? +## Q. What would be the output of following code? ```javascript -console.log("one"); -setTimeout(function () { - console.log("two"); -}, 0); -console.log("three"); +(function () { + var array = new Array("100"); + console.log(array); + console.log(array.length); +})(); ``` -_Answer:_ `one`, `three` and `two`. It's because `console.log('two');` will be -invoked in the next event loop. - -## Q. What would be the result of 1+2+'3'? - -The output is going to be `33`. Since `1` and `2` are numeric values, the result of first two digits is going to be a numeric value `3`. The next digit is a string type value because of that the addition of numeric value `3` and string type value `3` is just going to be a concatenation value `33`. +
Answer -## Q. Write a script that returns the number of occurrences of character given a string as input? +_Answer:_ 3) ["100"] 1 -```javascript -function countCharacters(str) { - return str - .replace(/ /g, "") - .toLowerCase() - .split("") - .reduce((arr, character) => { - if (character in arr) { - arr[character]++; - } else { - arr[character] = 1; - } - return arr; - }, {}); -} -console.log(countCharacters("the brown fox jumps over the lazy dog")); -``` +
-## Q. What is the value of `foo`? +## Q. What would be the output of following code? ```javascript -var foo = 10 + "20"; +(function () { + var array1 = []; + var array2 = new Array(100); + var array3 = new Array(["1", 2, "3", 4, 5.6]); + console.log(array1); + console.log(array2); + console.log(array3); + console.log(array3.length); +})(); ``` -_Answer:_ `'1020'`, because of type coercion from Number to String +
Answer -## Q. How would you make this work? +_Answer:_ [] [] [Array[5]] 1 -```javascript -add(2, 5); // 7 -add(2)(5); // 7 -``` +
-_Answer:_ A general solution for any number of parameters + -```js -"use strict"; +## Q. What would be the output of following code? -let sum = (arr) => arr.reduce((a, b) => a + b); -let addGenerator = (numArgs, prevArgs) => { - return function () { - let totalArgs = prevArgs.concat(Array.from(arguments)); - if (totalArgs.length === numArgs) { - return sum(totalArgs); - } - return addGenerator(numArgs, totalArgs); - }; -}; +```javascript +(function () { + var array = new Array("a", "b", "c", "d", "e"); + array[10] = "f"; + delete array[10]; + console.log(array.length); +})(); +``` -let add = addGenerator(2, []); +
Answer -add(2, 5); // 7 -add(2)(5); // 7 -add()(2, 5); // 7 -add()(2)(5); // 7 -add()()(2)(5); // 7 -``` +_Answer:_ 11 + +
-## Q. What value is returned from the following statement? +## Q. What would be the output of following code? ```javascript -"i'm a lasagna hog".split("").reverse().join(""); +(function () { + var animal = ["cow", "horse"]; + animal.push("cat"); + animal.push("dog", "rat", "goat"); + console.log(animal.length); +})(); ``` -_Answer:_ It's actually a reverse method for a string - `'goh angasal a m\'i'` +
Answer -## Q. What is the value of `window.foo`? +_Answer:_ 6 -```javascript -window.foo || (window.foo = "bar"); -``` +
-_Answer:_ Always `'bar'` + -## Q. What is the outcome of the two alerts below? +## Q. What would be the output of following code? ```javascript -var foo = "Hello"; (function () { - var bar = " World"; - alert(foo + bar); + var animal = ["cow", "horse"]; + animal.push("cat"); + animal.unshift("dog", "rat", "goat"); + console.log(animal); })(); -alert(foo + bar); ``` -_Answer:_ +
Answer -- First: `Hello World` -- Second: Throws an exception, `ReferenceError: bar is not defined` +_Answer:_ [ 'dog', 'rat', 'goat', 'cow', 'horse', 'cat' ] -## Q. What is the value of `foo.length`? +
+ + + +## Q. What would be the output of following code? ```javascript -var foo = []; -foo.push(1); -foo.push(2); +(function () { + var array = [1, 2, 3, 4, 5]; + console.log(array.indexOf(2)); + console.log([{ name: "John" }, { name: "John" }].indexOf({ name: "John" })); + console.log([[1], [2], [3], [4]].indexOf([3])); + console.log("abcdefgh".indexOf("e")); +})(); ``` -_Answer:_ `.push` is mutable - `2` +
Answer + +_Answer:_ 1) 1 -1 -1 4 + +
-## Q. What is the value of `foo.x`? +## Q. What would be the output of following code? ```javascript -var foo = { n: 1 }; -var bar = foo; -foo.x = foo = { n: 2 }; +(function () { + var array = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 6]; + console.log(array.indexOf(2)); + console.log(array.indexOf(2, 3)); + console.log(array.indexOf(2, 10)); +})(); ``` -_Answer:_ `undefined`. Rather, `bar.x` is `{n: 2}`. +
Answer -`foo.x = foo = {n: 2}` is the same as `foo.x = (foo = {n: 2})`. It is because -a left term is first referenced and then a right term is evaluated when an -assignment is performed in JavaScript. When `foo.x` is referenced, it refers -to an original object, `{n: 1}`. So, when the result of the right term, `{n: 2}`, is evaluated, it will assigned to the original object, which is at the -moment referenced by `bar`. +_Answer:_ 1 6 -1 + +
-## Q. What does the following code print? +## Q. What would be the output of following code? ```javascript -console.log("one"); -setTimeout(function () { - console.log("two"); -}, 0); -console.log("three"); +(function () { + var numbers = [2, 3, 4, 8, 9, 11, 13, 12, 16]; + var even = numbers.filter(function (element, index) { + return element % 2 === 0; + }); + console.log(even); + + var containsDivisibleby3 = numbers.some(function (element, index) { + return element % 3 === 0; + }); + + console.log(containsDivisibleby3); +})(); ``` -_Answer:_ `one`, `three` and `two`. It's because `console.log('two');` will be -invoked in the next event loop. +
Answer -## Q. For which value of x the results of the following statements are not the same? +_Answer:_ [ 2, 4, 8, 12, 16 ] true -```javascript -// if( x <= 100 ) {...} -if( !(x > 100) ) {...} -``` +
-_Answer:_ `NaN <= 100` is `false` and `NaN > 100` is also false, so if the value of `x` is `NaN`, the statements are not the same. + -The same holds true for any value of x that being converted to Number, returns NaN, e.g.: `undefined`, `[1,2,5]`, `{a:22}`, etc. -## Q. What is g value? +## Q. What would be the output of following code? ```javascript -f = g = 0; (function () { - try { - f = - function () { - return f(); - } && f(); - } catch (e) { - return g++ && f(); - } finally { - return ++g; - } - function f() { - g += 5; - return 0; - } + var containers = [2, 0, false, "", "12", true]; + var containers = containers.filter(Boolean); + console.log(containers); + var containers = containers.filter(Number); + console.log(containers); + var containers = containers.filter(String); + console.log(containers); + var containers = containers.filter(Object); + console.log(containers); })(); ``` +
Answer + +_Answer:_ +[ 2, '12', true ] +[ 2, '12', true ] +[ 2, '12', true ] +[ 2, '12', true ] + +
+ -## Q. What will be the output? +## Q. What would be the output of following code? ```javascript -function b(b) { - return this.b && b(b); -} -b(b.bind(b)); +(function () { + var list = ["foo", "bar", "john", "ritz"]; + console.log(list.slice(1)); + console.log(list.slice(1, 3)); + console.log(list.slice()); + console.log(list.slice(2, 2)); + console.log(list); +})(); ``` -## Q. What will be the output? +
Answer -```javascript -c = (c) => { - return this.c && c(c); -}; -c(c.bind(c)); -``` +_Answer:_ +[ 'bar', 'john', 'ritz' ] +[ 'bar', 'john' ] +[ 'foo', 'bar', 'john', 'ritz' ] +[] +[ 'foo', 'bar', 'john', 'ritz' ] -## Q. Predict the output of the following JavaScript code? +
-```javascript -var g = 0; -g = 1 && g++; -console.log(g); -``` + -## Q. Predict the output of the following JavaScript code? +## Q. What would be the output of following code? ```javascript -!function(){}() -function(){}() -true && function(){}() -(function(){})() -function(){} -!function(){} +(function () { + var list = ["foo", "bar", "john"]; + console.log(list.splice(1)); + console.log(list.splice(1, 2)); + console.log(list); +})(); ``` -## Q. What will expression return? +
Answer -```javascript -var a = (b = true), - c = (a) => a; -(function a(a = (c(b).a = c = () => a)) { - return a(); -})(); -``` +_Answer:_ [ 'bar', 'john' ] [] [ 'foo' ] -## Q. Predict the output of the following JavaScript code? +
+ + + +## Q. What would be the output of following code? ```javascript -var a = true; -(a = function () { - return a; +(function () { + var arrayNumb = [2, 8, 15, 16, 23, 42]; + arrayNumb.sort(); + console.log(arrayNumb); })(); ``` -## Q. What will be the output? +
Answer -```javascript -var v = 0; -try { - throw (v = (function (c) { - throw (v = function (a) { - return v; - }); - })()); -} catch (e) { - console.log(e()()); -} -``` +_Answer:_ [ 15, 16, 2, 23, 42, 8 ] + +
-## Q. What will the following code output? +## Q. What would be the output of following code? ```javascript -const arr = [10, 12, 15, 21]; -for (var i = 0; i < arr.length; i++) { - setTimeout(function () { - console.log("Index: " + i + ", element: " + arr[i]); - }, 3000); +function funcA() { + console.log("funcA ", this); + (function innerFuncA1() { + console.log("innerFunc1", this); + (function innerFunA11() { + console.log("innerFunA11", this); + })(); + })(); } -``` - -## Q. What will be the output of the following code? - -```javascript -var output = (function (x) { - delete x; - return x; -})(0); -console.log(output); +console.log(funcA()); ``` -## Q. What will be the output of the following code? +
Answer -```javascript -var Employee = { - company: "xyz", -}; -var emp1 = Object.create(Employee); -delete emp1.company; -console.log(emp1.company); -``` +_Answer:_ +funcA +innerFunc1 +innerFunA11 + +
-## Q. Make this work: +## Q. What would be the output of following code? ```javascript -duplicate([1, 2, 3, 4, 5]); // [1,2,3,4,5,1,2,3,4,5] +var obj = { + message: "Hello", + innerMessage: !(function () { + console.log(this.message); + })(), +}; + +console.log(obj.innerMessage); ``` -```javascript -function duplicate(arr) { - return arr.concat(arr); -} +
Answer -duplicate([1, 2, 3, 4, 5]); // [1,2,3,4,5,1,2,3,4,5] -``` +_Answer:_ undefined true + +
-## Q. Fix the bug using ES5 only? +## Q. What would be the output of following code? ```javascript -var arr = [10, 32, 65, 2]; -for (var i = 0; i < arr.length; i++) { - setTimeout(function () { - console.log("The index of this number is: " + i); - }, 3000); -} -``` - -For ES6, you can just replace `var i` with `let i`. - -For ES5, you need to create a function scope like here: +var obj = { + message: "Hello", + innerMessage: function () { + return this.message; + }, +}; -```javascript -var arr = [10, 32, 65, 2]; -for (var i = 0; i < arr.length; i++) { - setTimeout( - (function (j) { - return function () { - console.log("The index of this number is: " + j); - }; - })(i), - 3000 - ); -} +console.log(obj.innerMessage()); ``` +
Answer + +_Answer:_ Hello + +
+ -## Q. What will be the output of the following code? +## Q. What would be the output of following code? ```javascript -console.log(eval("10 + 10")); // 20 +var obj = { + message: "Hello", + innerMessage: function () { + (function () { + console.log(this.message); + })(); + }, +}; +console.log(obj.innerMessage()); +``` -console.log(eval("5 + 5" + 10)); // 515 +
Answer -console.log(eval("5 + 5 + 5" + 10)); // 520 +_Answer:_ undefined -console.log(eval(10 + "5 + 5")); // 110 +
-console.log(eval(10 + "5 + 5 + 5")); // 115 -``` + -## Q. What will be the output of the following code? +## Q. What would be the output of following code? ```javascript -var x = 10; -var y = 20; -var a = eval("x * y") + "
"; -var b = eval("2 + 2") + "
"; -var c = eval("x + 30") + "
"; - -let result = a + b + c; -console.log(result); // 200
4
40
+var obj = { + message: "Hello", + innerMessage: function () { + var self = this; + (function () { + console.log(self.message); + })(); + }, +}; +console.log(obj.innerMessage()); ``` +
Answer + +_Answer:_ 'Hello' + +
+ -## Q. What will be the output of the following code? +## Q. What would be the output of following code? ```javascript -// Example 01: -var prices = [12, 20, 18]; -var newPriceArray = [...prices]; -console.log(newPriceArray); - -// Example 02: -var alphabets = ["A", ..."BCD", "E"]; -console.log(alphabets); - -// Example 03: -var prices = [12, 20, 18]; -var maxPrice = Math.max(...prices); -console.log(maxPrice); +function myFunc() { + console.log(this.message); +} +myFunc.message = "Hi John"; -// Example 04: -var max = Math.max(..."43210"); -console.log(max); +console.log(myFunc()); +``` -// Example 05: -const fruits = ["apple", "orange"]; -const vegetables = ["carrot", "potato"]; +
Answer -const result = ["bread", ...vegetables, "chicken", ...fruits]; -console.log(result); +_Answer:_ undefined -// Example 06: -const country = "USA"; -console.log([...country]); -``` +
-## Q. Given and object and property path. Get value from property path +## Q. What would be the output of following code? ```javascript -function getPropertyValue(TEMP_OBJECT, path) { - return path.split('.').reduce((prev, key) => { - return prev ? prev[key] : undefined; - }, TEMP_OBJECT) +function myFunc() { + console.log(myFunc.message); } +myFunc.message = "Hi John"; -//Input : -let srcObject = { - 'system' : { - 'database' : { - '0' : { - 'host' : '54.232.122', - 'port' : 3306 - }, - '1' : { - 'host' : '54.232.123', - }, - 'port' : 3307 - '2' : { - 'host' : '54.232.123', - } - } - } -}, -path = "system.database.1.port"; - -//Output: 3307 +console.log(myFunc()); ``` +
Answer + +_Answer:_ 'Hi John' + +
+ -## Q. How to filter object from Arrays of Objects +## Q. What would be the output of following code? ```javascript -let filteredArray = [{name: 'john'},{name: 'kelly'}].filter(value => value.name === 'kelly'); - -Filter method return Array of objects +function myFunc() { + myFunc.message = "Hi John"; + console.log(myFunc.message); +} +console.log(myFunc()); ``` -## Q. How to replace all the occurrences of string +
Answer -```javascript -str = str.replace(/test/g, ""); -``` +_Answer:_ 'Hi John' + +
-## Q. Write a script that returns the number of occurrences of character given a string as input +## Q. What would be the output of following code? ```javascript -function countCharacters(str) { - return str - .replace(/ /g, "") - .toLowerCase() - .split("") - .reduce((p, c) => { - if (c in p) { - p[c]++; - } else { - p[c] = 1; - } - return p; - }, {}); +function myFunc(param1, param2) { + console.log(myFunc.length); } -console.log(countCharacters("the brown fox jumps over the lazy dog")); +console.log(myFunc()); +console.log(myFunc("a", "b")); +console.log(myFunc("a", "b", "c", "d")); ``` +
Answer + +_Answer:_ 2 2 2 + +
+ -## Q. write a script that return the number of occurrences of a character in paragraph +## Q. What would be the output of following code? ```javascript -function charCount(str, searchChar) { - let count = 0; - if (str) { - let stripStr = str.replace(/ /g, "").toLowerCase(); //remove spaces and covert to lowercase - for (let chr of stripStr) { - if (chr === searchChar) { - count++; - } - } - } - return count; +function myFunc() { + console.log(arguments.length); } -console.log(charCount("the brown fox jumps over the lazy dog", "o")); +console.log(myFunc()); +console.log(myFunc("a", "b")); +console.log(myFunc("a", "b", "c", "d")); ``` +
Answer + +_Answer:_ 0 2 4 + +
+ -## Q. Recursive and non-recursive Factorial function + +## Q. What would be the output of following code? ```javascript -function recursiveFactorial(n) { - if (n < 1) { - throw Error("Value of N has to be greater then 1"); - } - if (n === 1) { - return 1; - } else { - return n * recursiveFactorial(n - 1); - } +function Person(name, age) { + this.name = name || "John"; + this.age = age || 24; + this.displayName = function () { + console.log(this.name); + }; } -console.log(recursiveFactorial(5)); - -function factorial(n) { - if (n < 1) { - throw Error("Value of N has to be greater then 1"); - } - if (n === 1) { - return 1; - } - let result = 1; - for (let i = 1; i <= n; i++) { - result = result * i; - } - return result; -} +Person.name = "John"; +Person.displayName = function () { + console.log(this.name); +}; -console.log(factorial(5)); +var person1 = new Person("John"); +person1.displayName(); +Person.displayName(); ``` +
Answer + +_Answer:_ John Person + +
+ -## Q. Recursive and non recursive fibonacci-sequence +## Q. What would be the output of following code? ```javascript -// 1, 1, 2, 3, 5, 8, 13, 21, 34 - -function recursiveFibonacci(num) { - if (num <= 1) { - return 1; - } else { - return recursiveFibonacci(num - 1) + recursiveFibonacci(num - 2); - } +function passWordMngr() { + var password = "12345678"; + this.userName = "John"; + return { + pwd: password, + }; } +// Block End +var userInfo = passWordMngr(); +console.log(userInfo.pwd); +console.log(userInfo.userName); +``` -console.log(recursiveFibonacci(8)); +
Answer -function fibonnaci(num) { - let a = 1, - b = 0, - temp; - while (num >= 0) { - temp = a; - a = a + b; - b = temp; - num--; - } - return b; -} +_Answer:_ 12345678 undefined -console.log(fibonnaci(7)); +
-// Memoization fibonnaci + -function fibonnaci(num, memo = {}) { - if (num in memo) { - return memo[num]; - } - if (num <= 1) { - return 1; - } - return (memo[num] = fibonnaci(num - 1, memo) + fibonnaci(num - 2, memo)); +## Q. What would be the output of following code? + +```javascript +var employeeId = "aq123"; +function Employee() { + this.employeeId = "bq1uy"; } - -console.log(fibonnaci(5)); // 8 +console.log(Employee.employeeId); ``` -## Q. Random Number between min and max +
Answer -```javascript -// 5 to 7 -let min = 5; -let max = 7; -console.log(min + Math.floor(Math.random() * (max - min + 1))); -``` +_Answer:_ undefined + +
-## Q. Get HTML form values as JSON object +## Q. What would be the output of following code? ```javascript -// Use the array reduce function with form elements. -const formToJSON = (elements) => - [].reduce.call( - elements, - (data, element) => { - data[element.name] = element.value; - // Check if name and value exist on element - // Check if it checkbox or radio button which can select multiple or single - //check for multiple select options - return data; - }, - {} - ); +var employeeId = "aq123"; -// pass the elements to above method, to get values -document.querySelector("HTML_FORM_CLASS").elements; +function Employee() { + this.employeeId = "bq1uy"; +} +console.log(new Employee().employeeId); +Employee.prototype.employeeId = "kj182"; +Employee.prototype.JobId = "1BJKSJ"; +console.log(new Employee().JobId); +console.log(new Employee().employeeId); ``` +
Answer + +_Answer:_ bq1uy 1BJKSJ bq1uy + +
+ -## Q. Reverse the number +## Q. What would be the output of following code? ```javascript -function reverse(num) { - let result = 0; - while (num != 0) { - result = result * 10; - result = result + (num % 10); - num = Math.floor(num / 10); +var employeeId = "aq123"; +(function Employee() { + try { + throw "foo123"; + } catch (employeeId) { + console.log(employeeId); } - return result; -} - -console.log(reverse(12345)); + console.log(employeeId); +})(); ``` +
Answer + +_Answer:_ foo123 aq123 + +
+ -## Q. Remove Duplicate elements from Array +## Q. What would be the output of following code? ```javascript -var arr = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; -function removeDuplicate() { - return ar.reduce((prev, current) => { - //Cannot use includes of array, since it is not supported by many browser - if (prev.indexOf(current) === -1) { - prev.push(current); - } - return prev; - }, []); -} -console.log(removeDuplicate(ar)); - -const removeDuplicates = (arr) => { - let holder = {}; - return arr.filter((el) => { - if (!holder[el]) { - holder[el] = true; - return true; - } - return false; +(function () { + var greet = "Hello World"; + var toGreet = [].filter.call(greet, function (element, index) { + return index > 5; }); -}; -const arr = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; -console.log(removeDuplicates(arr)); // ["1", "2", "3", "5", "8", "9"] // O(n) - -// Es6 -console.log([...new Set(arr)]); + console.log(toGreet); +})(); ``` +
Answer + +_Answer:_ [ 'W', 'o', 'r', 'l', 'd' ] + +
+ -## Q. Deep copy of object or clone of object +## Q. What would be the output of following code? ```javascript -function deepExtend(out = {}) { - for (let i = 1; i < arguments.length; i++) { - let obj = arguments[i]; - if (obj == null) - // skip undefined and null [check with double equal not triple] - continue; - - obj = Object(obj); +(function () { + var fooAccount = { + name: "John", + amount: 4000, + deductAmount: function (amount) { + this.amount -= amount; + return "Total amount left in account: " + this.amount; + }, + }; + var barAccount = { + name: "John", + amount: 6000, + }; + var withdrawAmountBy = function (totalAmount) { + return fooAccount.deductAmount.bind(barAccount, totalAmount); + }; + console.log(withdrawAmountBy(400)()); + console.log(withdrawAmountBy(300)()); +})(); +``` - for (let key in obj) { - // avoid shadow hasownproperty of parent - if (Object.prototype.hasOwnProperty.call(obj, key)) { - if ( - typeof obj[key] === "object" && - !Array.isArray(obj[key]) && - obj[key] != null - ) - out[key] = deepExtend(out[key], obj[key]); - else out[key] = obj[key]; - } - } - } - return out; -} +
Answer -//Alternative if there are no function -let cloneObj = JSON.parse(JSON.stringify(obj)); +_Answer:_ Total amount left in account: 5600 Total amount left in account: 5300 -console.log(deepExtend({}, { a: 1, b: { c: 2, d: 3 } }, { e: 4, b: { f: 1 } })); -//output : { a: 1, b: {c: 2, d: 3, f: 1}, e: 4 } -``` +
-## Q. Sort ticket based on flying order. +## Q. What would be the output of following code? ```javascript -"use strict"; +(function () { + var fooAccount = { + name: "John", + amount: 4000, + deductAmount: function (amount) { + this.amount -= amount; + return this.amount; + }, + }; + var barAccount = { + name: "John", + amount: 6000, + }; + var withdrawAmountBy = function (totalAmount) { + return fooAccount.deductAmount.apply(barAccount, [totalAmount]); + }; + console.log(withdrawAmountBy(400)); + console.log(withdrawAmountBy(300)); + console.log(withdrawAmountBy(200)); +})(); +``` -function SortTickets(tickets) { - this.tickets = tickets; +
Answer - // reverse the order of tickets - this.reverseTickets = {}; - for (let key in this.tickets) { - this.reverseTickets[tickets[key]] = key; - } +_Answer:_ 5600 5300 5100 - // Get the starting point of ticket - let orderedTivckets = [...this.getStartingPoint()]; +
- // Get the ticket destination. - let currentValue = orderedTickets[orderedTickets.length - 1]; - while (currentValue) { - currentValue = this.tickets[currentValue]; - if (currentValue) { - orderedTickets.push(currentValue); - } - } - console.log(orderedTickets); -} + -SortTickets.prototype.getStartingPoint = function () { - for (let tick in this.tickets) { - if (!(tick in this.reverseTickets)) { - return [tick, this.tickets[tick]]; - } - } - return null; -}; +## Q. What would be the output of following code? -new SortTickets({ - Athens: "Rio", - Barcelona: "Athens", - London: "NYC", - ND: "Lahore", - NYC: "Barcelona", - Rio: "ND", -}); +```javascript +(function () { + var fooAccount = { + name: "John", + amount: 6000, + deductAmount: function (amount) { + this.amount -= amount; + return this.amount; + }, + }; + var barAccount = { + name: "John", + amount: 4000, + }; + var withdrawAmountBy = function (totalAmount) { + return fooAccount.deductAmount.call(barAccount, totalAmount); + }; + console.log(withdrawAmountBy(400)); + console.log(withdrawAmountBy(300)); + console.log(withdrawAmountBy(200)); +})(); +``` + +
Answer + +_Answer:_ 3600 3300 3100 + +
+ + + +## Q. What would be the output of following code? + +```javascript +(function greetNewCustomer() { + console.log("Hello " + this.name); +}.bind({ + name: "John", +})()); ``` +
Answer + +_Answer:_ 1) Hello John + +
+ -## Q. Cuncurrent execute function based on input number +## Q. What would be the output of following code? ```javascript -function concurrent(num) { - this.queue = []; - this.num = num; +function getDataFromServer(apiUrl) { + var name = "John"; + return { + then: function (fn) { + fn(name); + }, + }; } -concurrent.prototype.enqueue = function (value) { - this.queue.push(value); -}; +getDataFromServer("www.google.com").then(function (name) { + console.log(name); +}); +``` -concurrent.prototype.start = function () { - this.runningCount = 0; - while (this.queue.length > 0) { - if (this.runningCount < this.num) { - this.queue.pop().call(this, () => { - this.runningCount--; - let count = this.runningCount; - if (count === 0) { - this.start(); - } - }); - this.runningCount++; - } - } -}; +
Answer -let callback = (done) => { - console.log("starting"); - setTimeout(() => { - console.log("stopped"); - done(); - }, 200); -}; +_Answer:_ John -let c = new concurrent(2); -c.enqueue(callback); -c.enqueue(callback); -c.enqueue(callback); -c.enqueue(callback); -c.enqueue(callback); -c.enqueue(callback); -c.start(); -``` +
-## Q. Reversing an array +## Q. What would be the output of following code? ```javascript -let a = [1, 2, 3, 4, 5]; - -//Approach 1: -console.log(a.reverse()); +(function () { + var arrayNumb = [2, 8, 15, 16, 23, 42]; + Array.prototype.sort = function (a, b) { + return a - b; + }; + arrayNumb.sort(); + console.log(arrayNumb); +})(); -//Approach 2: -let reverse = a.reduce((prev, current) => { - prev.unshift(current); - return prev; -}, []); +(function () { + var numberArray = [2, 8, 15, 16, 23, 42]; + numberArray.sort(function (a, b) { + if (a == b) { + return 0; + } else { + return a < b ? -1 : 1; + } + }); + console.log(numberArray); +})(); -console.log(reverse); +(function () { + var numberArray = [2, 8, 15, 16, 23, 42]; + numberArray.sort(function (a, b) { + return a - b; + }); + console.log(numberArray); +})(); ``` -## Q. Rotate 2D array +
Answer -```javascript -const transpose = (arr) => arr[0].map((col, i) => arr.map((row) => row[i])); +_Answer:_ +[ 2, 8, 15, 16, 23, 42 ] +[ 2, 8, 15, 16, 23, 42 ] +[ 2, 8, 15, 16, 23, 42 ] -console.log( - transpose([ - [1, 2, 3, 4], - [5, 6, 7, 8], - [9, 10, 11, 12], - ]) -); -``` +
-## Q. Get Column from 2D Array + + +## Q. What would be the output of following code? ```javascript -const getColumn = (arr, n) => arr.map((x) => x[n]); +(function () { + function sayHello() { + var name = "Hi John"; + return; + { + fullName: name; + } + } + console.log(sayHello().fullName); +})(); +``` -const twoDimensionalArray = [ - [1, 2, 3], - [4, 5, 6], - [7, 8, 9], -]; +
Answer -console.log(getColumn(twoDimensionalArray, 1)); //Result = [2,5,8] -``` +_Answer:_ Uncaught TypeError: Cannot read property 'fullName' of undefined -## Q. Get top N from array +
+ + + +## Q. What would be the output of following code? ```javascript -function topN(arr, num) { - let sorted = arr.sort((a, b) => a - b); - return sorted.slice(sorted.length - num, sorted.length); +function getNumber() { + return 2, 4, 5; } -console.log(topN([1, 8, 3, 4, 5], 2)); // [5,8] +var numb = getNumber(); +console.log(numb); ``` +
Answer + +_Answer:_ 5 + +
+ -## Q. Get query params from Object +## Q. What would be the output of following code? ```javascript -function getQueryParams(obj) { - let parms = ""; - for (let key in obj) { - if (obj.hasOwnProperty(key)) { - if (parms.length > 0) { - parms += "&"; - } - parms += encodeURI(`${key}=${obj[key]}`); - } - } - return parms; +function getNumber() { + return; } -console.log( - getQueryParams({ - name: "Umesh", - tel: "48289", - add: "3333 emearld st", - }) -); +var numb = getNumber(); +console.log(numb); ``` +
Answer + +_Answer:_ undefined + +
+ -## Q. Consecutive 1's in binary +## Q. What would be the output of following code? ```javascript -function consecutiveOne(num) { - let binaryArray = num.toString(2); - - let maxOccurence = 0, - occurence = 0; - for (let val of binaryArray) { - if (val === "1") { - occurence += 1; - maxOccurence = Math.max(maxOccurence, occurence); - } else { - occurence = 0; - } - } - return maxOccurence; +function mul(x) { + return function (y) { + return [ + x * y, + function (z) { + return x * y + z; + }, + ]; + }; } -//13 = 1101 = 2 -//5 = 101 = 1 -console.log(consecutiveOne(5)); //1 + +console.log(mul(2)(3)[0]); +console.log(mul(2)(3)[1](4)); ``` +
Answer + +_Answer:_ 6, 10 + +
+ -## Q. Spiral travesal of matrix +## Q. What would be the output of following code? ```javascript -var input = [ - [1, 2, 3, 4], - [5, 6, 7, 8], - [9, 10, 11, 12], - [13, 14, 15, 16], -]; +function mul(x) { + return function (y) { + return { + result: x * y, + sum: function (z) { + return x * y + z; + }, + }; + }; +} +console.log(mul(2)(3).result); +console.log(mul(2)(3).sum(4)); +``` -var spiralTraversal = function (matriks) { - let result = []; - var goAround = function (matrix) { - if (matrix.length === 0) { - return; - } +
Answer - // right - result = result.concat(matrix.shift()); +_Answer:_ 6, 10 - // down - for (var j = 0; j < matrix.length - 1; j++) { - result.push(matrix[j].pop()); - } +
- // bottom - result = result.concat(matrix.pop().reverse()); + - // up - for (var k = matrix.length - 1; k > 0; k--) { - result.push(matrix[k].shift()); - } +## Q. What would be the output of following code? - return goAround(matrix); +```javascript +function mul(x) { + return function (y) { + return function (z) { + return function (w) { + return function (p) { + return x * y * z * w * p; + }; + }; + }; }; +} +console.log(mul(2)(3)(4)(5)(6)); +``` - goAround(matriks); +
Answer - return result; -}; -console.log(spiralTraversal(input)); // [1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10] -``` +_Answer:_ 720 + +
-## Q. Merge Sorted array and sort it. +## Q. What is the value of `foo`? ```javascript -function mergeSortedArray(arr1, arr2) { - return [...new Set(arr1.concat(arr2))].sort((a, b) => a - b); -} - -console.log(mergeSortedArray([1, 2, 3, 4, 5, 6], [0, 3, 4, 7])); // [0, 1, 2, 3, 4, 5, 6, 7] +var foo = 10 + "20"; ``` +
Answer + +_Answer:_ `'1020'`, because of type coercion from Number to String + +
+ -## Q. Anagram of words +## Q. How would you make this work? ```javascript -const alphabetize = (word) => word.split("").sort().join(""); +add(2, 5); // 7 +add(2)(5); // 7 +``` -function groupAnagram(wordsArr) { - return wordsArr.reduce((p, c) => { - const sortedWord = alphabetize(c); - if (sortedWord in p) { - p[sortedWord].push(c); - } else { - p[sortedWord] = [c]; +
Answer + +_Answer:_ A general solution for any number of parameters + +```javascript +"use strict"; + +let sum = (arr) => arr.reduce((a, b) => a + b); +let addGenerator = (numArgs, prevArgs) => { + return function () { + let totalArgs = prevArgs.concat(Array.from(arguments)); + if (totalArgs.length === numArgs) { + return sum(totalArgs); } - return p; - }, {}); -} + return addGenerator(numArgs, totalArgs); + }; +}; -console.log( - groupAnagram(["map", "art", "how", "rat", "tar", "who", "pam", "shoop"]) -); -// result : { -// amp: ["map", "pam"], -// art: ["art", "rat", "tar"], -// hoops: ["shoop"], -// how: ["how", "who"] -// } +let add = addGenerator(2, []); + +add(2, 5); // 7 +add(2)(5); // 7 +add()(2, 5); // 7 +add()(2)(5); // 7 +add()()(2)(5); // 7 ``` +
+ -## Q. Print the largest (maximum) hourglass sum found in 2d array. +## Q. What value is returned from the following statement? ```javascript -// if arr 6 X 6 then iterate it till 4 X 4 [reduce by two] -// if arr 8 X 8 then iterate it till 6 X 6 [reduce by two] -function main(arr) { - let maxScore = -999; - let len = arr.length; - for (let i = 0; i < len - 2; i++) { - for (let j = 0; j < len - 2; j++) { - let total = - arr[i][j] + - arr[i][j + 1] + - arr[i][j + 2] + - arr[i + 1][j + 1] + - arr[i + 2][j] + - arr[i + 2][j + 1] + - arr[i + 2][j + 2]; - - maxScore = Math.max(maxScore, total); - } - } - console.log(maxScore); -} +"i'm a lasagna hog".split("").reverse().join(""); ``` +
Answer + +_Answer:_ It\'s actually a reverse method for a string - `'goh angasal a m\'i'` + +
+ -## Q. Transform array of object to array +## Q. What is the value of `window.foo`? ```javascript -let data = [ - { vid: "aaa", san: 12 }, - { vid: "aaa", san: 18 }, - { vid: "aaa", san: 2 }, - { vid: "bbb", san: 33 }, - { vid: "bbb", san: 44 }, - { vid: "aaa", san: 100 }, -]; +window.foo || (window.foo = "bar"); +``` -let newData = data.reduce((acc, item) => { - acc[item.vid] = acc[item.vid] || { vid: item.vid, san: [] }; - acc[item.vid]["san"].push(item.san); - return acc; -}, {}); +
Answer -console.log(Object.keys(newData).map((key) => newData[key])); +_Answer:_ Always `'bar'` -// Result -// [[object Object] { -// san: [12, 18, 2, 100], -// vid: "aaa" -// }, [object Object] { -// san: [33, 44], -// vid: "bbb" -// }] -``` +
-## Q. Create a private variable or private method in object +## Q. What is the outcome of the two alerts below? ```javascript -let obj = (function () { - function getPrivateFunction() { - console.log("this is private function"); - } - let p = "You are accessing private variable"; - return { - getPrivateProperty: () => { - console.log(p); - }, - callPrivateFunction: getPrivateFunction, - }; +var foo = "Hello"; +(function () { + var bar = " World"; + alert(foo + bar); })(); - -obj.getPrivateValue(); // You are accessing private variable -console.log("p" in obj); // false -obj.callPrivateFunction(); // this is private function +alert(foo + bar); ``` +
Answer + +_Answer:_ + +- First: `Hello World` +- Second: Throws an exception, `ReferenceError: bar is not defined` + +
+ -## Q. Flatten only Array not objects +## Q. What is the value of `foo.length`? ```javascript -function flatten(arr, result = []) { - arr.forEach((val) => { - if (Array.isArray(val)) { - flatten(val, result); - } else { - result.push(val); - } - }); - return result; -} +var foo = []; +foo.push(1); +foo.push(2); +``` -let input = [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; -console.log(flatten(input)); // [1, { a: [2, [3]]}, 4, 5, 6, 7, "hi", 8, 9, 10] +
Answer -function flattenIterative(out) { - // iteratively - let result = out; - while (result.some(Array.isArray)) { - result = [].concat.apply([], result); - } - return result; -} -var list1 = [ - [0, 1], - [2, 3], - [4, 5], -]; -console.log(flattenIterative(list1)); // [0, 1, 2, 3, 4, 5] +_Answer:_ `.push` is mutable - `2` -function flattenIterative1(current) { - let result = []; - while (current.length) { - let firstValue = current.shift(); - if (Array.isArray(firstValue)) { - current = firstValue.concat(current); - } else { - result.push(firstValue); - } - } - return result; -} +
-let input = [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; -console.log(flattenIterative1(input)); -var list2 = [0, [1, [2, [3, [4, [5]]]]]]; -console.log(flattenIterative1(list2)); // [0, 1, 2, 3, 4, 5] + + +## Q. What is the value of `foo.x`? + +```javascript +var foo = { n: 1 }; +var bar = foo; +foo.x = foo = { n: 2 }; ``` +
Answer + +_Answer:_ `undefined`. Rather, `bar.x` is `{n: 2}`. + +`foo.x = foo = {n: 2}` is the same as `foo.x = (foo = {n: 2})`. It is because +a left term is first referenced and then a right term is evaluated when an +assignment is performed in JavaScript. When `foo.x` is referenced, it refers +to an original object, `{n: 1}`. So, when the result of the right term, `{n: 2}`, is evaluated, it will assigned to the original object, which is at the +moment referenced by `bar`. + +
+ -## Q. Find max difference between two number in Array +## Q. What does the following code print? ```javascript -function maxDifference(arr) { - let maxDiff = 0; +console.log("one"); +setTimeout(function () { + console.log("two"); +}, 0); +console.log("three"); +``` - for (let i = 0; i < arr.length; i++) { - for (let j = i + 1; j < arr.length; j++) { - let diff = Math.abs(arr[i] - arr[j]); - maxDiff = Math.max(maxDiff, diff); - } - } - return maxDiff; -} +
Answer -console.log(maxDifference([1, 2, 4])); // [1 - 4 ] = 3 -``` +_Answer:_ `one`, `three` and `two`. It's because `console.log('two');` will be +invoked in the next event loop. -## Q. swap two number in ES6 [destructing] +
-```javascript -let a = 10, - b = 5; -[a, b] = [b, a]; -``` + + +## Q. What would be the result of 1+2+'3'? + +
Answer + +The output is going to be `33`. Since `1` and `2` are numeric values, the result of first two digits is going to be a numeric value `3`. The next digit is a string type value because of that the addition of numeric value `3` and string type value `3` is just going to be a concatenation value `33`. + +
-## Q. Panagram ? it means all the 26 letters of alphabet are there +## Q. What is the value of `foo`? ```javascript -function panagram(input) { - if (input == null) { - // Check for null and undefined - return false; - } - - if (input.length < 26) { - // if length is less then 26 then it is not - return false; - } - input = input.replace(/ /g, "").toLowerCase().split(""); - let obj = input.reduce((prev, current) => { - if (!(current in prev)) { - prev[current] = current; - } - return prev; - }, {}); - console.log(Object.keys(obj).length === 26 ? "panagram" : "not pangram"); -} -processData("We promptly judged antique ivory buckles for the next prize"); // pangram -processData("We promptly judged antique ivory buckles for the prize"); // Not Pangram +var foo = 10 + "20"; ``` +
Answer + +_Answer:_ `'1020'`, because of type coercion from Number to String + +
+ -## Q. Given two identical DOM trees (not the same one), and a node from one of them find the node in the other one. +## Q. For which value of x the results of the following statements are not the same? ```javascript -function indexOf(arrLike, target) { - return Array.prototype.indexOf.call(arrLike, target); -} +// if( x <= 100 ) {...} +if( !(x > 100) ) {...} +``` -// Given a node and a tree, extract the nodes path -function getPath(root, target) { - var current = target; - var path = []; - while (current !== root) { - let parentNode = current.parentNode; - path.unshift(indexOf(parentNode.childNodes, current)); - current = parentNode; - } - return path; -} +
Answer -// Given a tree and a path, let's locate a node -function locateNodeFromPath(node, path) { - return path.reduce((root, index) => root.childNodes[index], node); -} +_Answer:_ `NaN <= 100` is `false` and `NaN > 100` is also false, so if the value of `x` is `NaN`, the statements are not the same. -const rootA = document.querySelector("#root-a"); -const rootB = document.querySelector("#root-b"); -const target = rootA.querySelector(".person__age"); +The same holds true for any value of x that being converted to Number, returns NaN, e.g.: `undefined`, `[1,2,5]`, `{a:22}`, etc. -console.log(locateNodeFromPath(rootB, getPath(rootA, target))); -``` +
-## Q. Convert a number into a Roman Numeral +## Q. What is g value? ```javascript -function romanize(num) { - let lookup = { - M: 1000, - CM: 900, - D: 500, - CD: 400, - C: 100, - XC: 90, - L: 50, - XL: 40, - X: 10, - IX: 9, - V: 5, - IV: 4, - I: 1, - }, - roman = ""; - for (let i in lookup) { - while (num >= lookup[i]) { - roman += i; - num -= lookup[i]; - } +f = g = 0; +(function () { + try { + f = + function () { + return f(); + } && f(); + } catch (e) { + return g++ && f(); + } finally { + return ++g; } - return roman; -} - -console.log(romanize(3)); // III + function f() { + g += 5; + return 0; + } +})(); ``` -## Q. check if parenthesis is malformed or not +## Q. What will be the output? ```javascript -function matchParenthesis(str) { - let obj = { "{": "}", "(": ")", "[": "]" }; - let result = []; - for (let s of str) { - if (s === "{" || s === "(" || s === "[") { - // All opening brackets - result.push(s); - } else { - if (result.length > 0) { - let lastValue = result.pop(); //pop the last value and compare with key - if (obj[lastValue] !== s) { - // if it is not same then it is not formated properly - return false; - } - } else { - return false; // empty array, there is nothing to pop. so it is not formated properly - } - } - } - return result.length === 0; +function b(b) { + return this.b && b(b); } +b(b.bind(b)); +``` -console.log(matchParenthesis("}{{}}"), matchParenthesis("{{[]}}")); // false - true +## Q. What will be the output? + +```javascript +c = (c) => { + return this.c && c(c); +}; +c(c.bind(c)); ``` - +## Q. Predict the output of the following JavaScript code? -## Q. Create Custom Event Emitter class +```javascript +var g = 0; +g = 1 && g++; +console.log(g); +``` + +## Q. Predict the output of the following JavaScript code? ```javascript -class EventEmitter { - constructor() { - this.holder = {}; - } +!function(){}() +function(){}() +true && function(){}() +(function(){})() +function(){} +!function(){} +``` - on(eventName, fn) { - if (eventName && typeof fn === "function") { - this.holder[eventName] = this.holder[eventName] || []; - this.holder[eventName].push(fn); - } - } +## Q. What will expression return? - emit(eventName, ...args) { - let eventColl = this.holder[eventName]; - if (eventColl) { - eventColl.forEach((callback) => callback(args)); - } - } -} +```javascript +var a = (b = true), + c = (a) => a; +(function a(a = (c(b).a = c = () => a)) { + return a(); +})(); +``` -let e = new EventEmitter(); -e.on("callme", function (args) { - console.log(`you called me ${args}`); -}); -e.on("callme", function (args) { - console.log(`testing`); -}); +## Q. Predict the output of the following JavaScript code? -e.emit("callme", ["a", "b"], { firstName: "umesh", lastName: "gohil" }); +```javascript +var a = true; +(a = function () { + return a; +})(); ``` - - -## Q. Max value from an array +## Q. What will be the output? ```javascript -const arr = [-2, -3, 4, 3, 2, 1]; -Math.max(...arr); // Fastest - -Math.max.apply(Math, arr); // Slow +var v = 0; +try { + throw (v = (function (c) { + throw (v = function (a) { + return v; + }); + })()); +} catch (e) { + console.log(e()()); +} ``` -## Q. DOM methods +## Q. What will the following code output? ```javascript -https://github.com/nefe/You-Dont-Need-jQuery - -var el = document.querySelector('div'); -el.childNodes; // get the list of child nodes of el -el.firstChild; // get the first child node of el -el.lastChild; // get the last child node of el -el.parentNode; // get the parent node of el -el.previousSibling; // get the previous sibling of el -el.nextSibling; // get the next sibling of el -el.textContent; // get the text content of el -el.innerHTML; // get the inner html of el - -document.createElement('div') // create dom element -document.creatTextNode('Hello world'); // create text node -document.createDocumentFragment(); - -el.appendChild(); //append child to el; -el.insertBefore(); // insert child before el; -el.parentNode.replaceChild(NEW_NODE, REPLACE_ME) // replace the node -el.removechild(); // remove the child node +const arr = [10, 12, 15, 21]; +for (var i = 0; i < arr.length; i++) { + setTimeout(function () { + console.log("Index: " + i + ", element: " + arr[i]); + }, 3000); +} +``` -Array.from(NODES) // convert nodelist to regular array +## Q. What will be the output of the following code? -el.classList[contains | add | remove | replace] // class of el +```javascript +var output = (function (x) { + delete x; + return x; +})(0); -el.dataset. // data-count is dataset.count, data-index-number is dataset.indexNumber +console.log(output); +``` -el.setAttribute | el.getAttribute | el.removeAttribute // attributes of el +## Q. What will be the output of the following code? -el.style // get the style of el +```javascript +var Employee = { + company: "xyz", +}; +var emp1 = Object.create(Employee); +delete emp1.company; +console.log(emp1.company); ``` -## Q. search function called after 500 ms +## Q. Fix the bug using ES5 only? ```javascript -; - -let timer = null; -function searchOptions(value) { - clearTimeout(timer); - timer = setTimeout(() => { - console.log(`value is - ${value}`); - }, 500); +var arr = [10, 32, 65, 2]; +for (var i = 0; i < arr.length; i++) { + setTimeout(function () { + console.log("The index of this number is: " + i); + }, 3000); } - -let search = document.querySelector(".search"); -search.addEventListener("keyup", function () { - searchOptions(this.value); -}); ``` - +
Answer -## Q. Move all zero's to end +For ES6, you can just replace `var i` with `let i`. -```javascript -const moveZeroToEnd = (arr) => { - for (let i = 0, j = 0; j < arr.length; j++) { - if (arr[j] !== 0) { - if (i < j) { - [arr[i], arr[j]] = [arr[j], arr[i]]; // swap i and j - } - i++; - } - } - return arr; -}; +For ES5, you need to create a function scope like here: -console.log(moveZeroToEnd([1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0])); // [1, 8, 2, 3, 4, 5, 0, 0, 0, 0, 0] +```javascript +var arr = [10, 32, 65, 2]; +for (var i = 0; i < arr.length; i++) { + setTimeout( + (function (j) { + return function () { + console.log("The index of this number is: " + j); + }; + })(i), + 3000 + ); +} ``` +
+ -## Q. Decode message in matrix [diagional down right, diagional up right] +## Q. What will be the output of the following code? ```javascript -const decodeMessage = (mat) => { - // check if matrix is null or empty - if (mat == null || mat.length === 0) { - return ""; - } - let x = mat.length - 1; - let y = mat[0].length - 1; - let message = ""; - let decode = (mat, i = 0, j = 0, direction = "DOWN") => { - message += mat[i][j]; - - if (i === x) { - direction = "UP"; - } - - if (direction === "DOWN") { - i++; - } else { - i--; - } +console.log(eval("10 + 10")); - if (j === y) { - return; - } +console.log(eval("5 + 5" + 10)); - j++; - decode(mat, i, j, direction); - }; - decode(mat); - return message; -}; +console.log(eval("5 + 5 + 5" + 10)); -let mat = [ - ["I", "B", "C", "A", "L", "K", "A"], - ["D", "R", "F", "C", "A", "E", "A"], - ["G", "H", "O", "E", "L", "A", "D"], - ["G", "H", "O", "E", "L", "A", "D"], -]; +console.log(eval(10 + "5 + 5")); -console.log(decodeMessage(mat)); //IROELEA +console.log(eval(10 + "5 + 5 + 5")); ``` - - -## Q. find a pair in array, whose sum is equal to given number. +## Q. What will be the output of the following code? ```javascript -const hasPairSum = (arr, sum) => { - if (arr == null && arr.length < 2) { - return false; - } - - let left = 0; - let right = arr.length - 1; - let result = false; - - while (left < right && !result) { - let pairSum = arr[left] + arr[right]; - if (pairSum < sum) { - left++; - } else if (pairSum > sum) { - right--; - } else { - result = true; - } - } - return result; -}; - -console.log(hasPairSum([1, 2, 4, 5], 8)); // null -console.log(hasPairSum([1, 2, 4, 4], 8)); // [2,3] - -const hasPairSum = (arr, sum) => { - let difference = {}; - let hasPair = false; - arr.forEach((item) => { - let diff = sum - item; - if (!difference[diff]) { - difference[item] = true; - } else { - hasPair = true; - } - }); - return hasPair; -}; -console.log(hasPairSum([6, 4, 3, 8], 8)); +var x = 10; +var y = 20; +var a = eval("x * y") + "
"; +var b = eval("2 + 2") + "
"; +var c = eval("x + 30") + "
"; -// NOTE: if array is not sorted then subtract the value with sum and store in difference -// then see if that value exist in difference then return true. +let result = a + b + c; +console.log(result); ``` -## Q. Binary Search [Array should be sorted] +## Q. What will be the output of the following code? ```javascript -function binarySearch(arr, val) { - let startIndex = 0, - stopIndex = arr.length - 1, - middleIndex = Math.floor((startIndex + stopIndex) / 2); - - while (arr[middleIndex] !== val && startIndex < stopIndex) { - if (val < arr[middleIndex]) { - stopIndex = middleIndex - 1; - } else if (val > arr[middleIndex]) { - startIndex = middleIndex + 1; - } - middleIndex = Math.floor((startIndex + stopIndex) / 2); - } +// Example 01: +var prices = [12, 20, 18]; +var newPriceArray = [...prices]; +console.log(newPriceArray); - return arr[middleIndex] === val ? middleIndex : -1; -} +// Example 02: +var alphabets = ["A", ..."BCD", "E"]; +console.log(alphabets); -console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 22)); -console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 27)); -``` +// Example 03: +var prices = [12, 20, 18]; +var maxPrice = Math.max(...prices); +console.log(maxPrice); - +// Example 04: +var max = Math.max(..."43210"); +console.log(max); -## Q. Pascal triangle. +// Example 05: +const fruits = ["apple", "orange"]; +const vegetables = ["carrot", "potato"]; -```javascript -function pascalTriangle(n) { - let last = [1], - triangle = [last]; - for (let i = 0; i < n; i++) { - const ls = [0].concat(last), //[0,1] // [0,1,1] - rs = last.concat([0]); //[1,0] // [1,1,0] - last = rs.map((r, i) => ls[i] + r); //[1, 1] // [1,2,1] - triangle = triangle.concat([last]); // [[1], [1,1]] // [1], [1, 1], [1, 2, 1] - } - return triangle; -} +const result = ["bread", ...vegetables, "chicken", ...fruits]; +console.log(result); -console.log(pascalTriangle(2)); +// Example 06: +const country = "USA"; +console.log([...country]); ``` -## Q. Explain the code below. How many times the createVal function is called? +## Q. How many times the createVal function is called? ```javascript function createVal() { @@ -5156,17 +4988,16 @@ function sayHi() { sayHi(); ``` -- A: `Lydia` and `undefined` -- B: `Lydia` and `ReferenceError` -- C: `ReferenceError` and `21` -- D: `undefined` and `ReferenceError` +
Answer -**Answer: D** +**Answer:** Within the function, we first declare the `name` variable with the `var` keyword. This means that the variable gets hoisted (memory space is set up during the creation phase) with the default value of `undefined`, until we actually get to the line where we define the variable. We haven't defined the variable yet on the line where we try to log the `name` variable, so it still holds the value of `undefined`. Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don't get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`. +
+ @@ -5183,16 +5014,16 @@ for (let i = 0; i < 3; i++) { } ``` -- A: `0 1 2` and `0 1 2` -- B: `0 1 2` and `3 3 3` -- C: `3 3 3` and `0 1 2` +
Answer -**Answer: C** +**Answer:** Because of the event queue in JavaScript, the `setTimeout` callback function is called _after_ the loop has been executed. Since the variable `i` in the first loop was declared using the `var` keyword, this value was global. During the loop, we incremented the value of `i` by `1` each time, using the unary operator `++`. By the time the `setTimeout` callback function was invoked, `i` was equal to `3` in the first example. In the second loop, the variable `i` was declared using the `let` keyword: variables declared with the `let` (and `const`) keyword are block-scoped (a block is anything between `{ }`). During each iteration, `i` will have a new value, and each value is scoped inside the loop. +
+ @@ -5212,12 +5043,9 @@ console.log(shape.diameter()); console.log(shape.perimeter()); ``` -- A: `20` and `62.83185307179586` -- B: `20` and `NaN` -- C: `20` and `63` -- D: `NaN` and `63` +
Answer -**Answer: B** +**Answer:** Note that the value of `diameter` is a regular function, whereas the value of `perimeter` is an arrow function. @@ -5225,6 +5053,8 @@ With arrow functions, the `this` keyword refers to its current surrounding scope There is no value `radius` on that object, which returns `undefined`. +
+ @@ -5236,16 +5066,16 @@ There is no value `radius` on that object, which returns `undefined`. !"Lydia"; ``` -- A: `1` and `false` -- B: `false` and `NaN` -- C: `false` and `false` +
Answer -**Answer: A** +**Answer:** The unary plus tries to convert an operand to a number. `true` is `1`, and `false` is `0`. The string `'Lydia'` is a truthy value. What we're actually asking, is "is this truthy value falsy?". This returns `false`. +
+ From ea5de77a5789e2297eac9b84e5174a27d52ed203 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 23 Oct 2022 12:01:21 +0530 Subject: [PATCH 029/117] Update README.md --- README.md | 163 ++++++++++++++++++++++++++---------------------------- 1 file changed, 78 insertions(+), 85 deletions(-) diff --git a/README.md b/README.md index 27a5b42..434b87c 100644 --- a/README.md +++ b/README.md @@ -2493,7 +2493,7 @@ console.log(output);
Answer -The code above will output `0` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **local variable**. `delete` operator doesn't affect local variables. +The code above will output `0` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **local variable**. `delete` operator doesn\'t affect local variables.
@@ -2558,9 +2558,9 @@ console.log(emp1.company);
Answer -The code above will output `xyz` as output. Here `emp1` object got company as **prototype** property. delete operator doesn't delete prototype property. +The code above will output `xyz` as output. Here `emp1` object got company as **prototype** property. delete operator doesn\'t delete prototype property. -`emp1` object doesn't have **company** as its own property. you can test it `console.log(emp1.hasOwnProperty('company')); //output : false` However, we can delete company property directly from `Employee` object using `delete Employee.company` or we can also delete from `emp1` object using `__proto__` property `delete emp1.__proto__.company`. +`emp1` object doesn\'t have **company** as its own property. you can test it `console.log(emp1.hasOwnProperty('company')); //output : false` However, we can delete company property directly from `Employee` object using `delete Employee.company` or we can also delete from `emp1` object using `__proto__` property `delete emp1.__proto__.company`.
@@ -2951,7 +2951,7 @@ console.log(arrA); The output will be `[{prop1: 42}, {someProp: "also value of array A!"}, 3,4,5]`. The `slice` function copies all the elements of the array returning the new array. However, -it doesn't do deep copying. Instead it does shallow copying. You can imagine slice implemented like this: +it doesn\'t do deep copying. Instead it does shallow copying. You can imagine slice implemented like this: ```javascript function slice(arr) { @@ -4992,9 +4992,9 @@ sayHi(); **Answer:** -Within the function, we first declare the `name` variable with the `var` keyword. This means that the variable gets hoisted (memory space is set up during the creation phase) with the default value of `undefined`, until we actually get to the line where we define the variable. We haven't defined the variable yet on the line where we try to log the `name` variable, so it still holds the value of `undefined`. +Within the function, we first declare the `name` variable with the `var` keyword. This means that the variable gets hoisted (memory space is set up during the creation phase) with the default value of `undefined`, until we actually get to the line where we define the variable. We haven\'t defined the variable yet on the line where we try to log the `name` variable, so it still holds the value of `undefined`. -Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don't get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`. +Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don\'t get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`.
@@ -5049,7 +5049,7 @@ console.log(shape.perimeter()); Note that the value of `diameter` is a regular function, whereas the value of `perimeter` is an arrow function. -With arrow functions, the `this` keyword refers to its current surrounding scope, unlike regular functions! This means that when we call `perimeter`, it doesn't refer to the shape object, but to its surrounding scope (window for example). +With arrow functions, the `this` keyword refers to its current surrounding scope, unlike regular functions! This means that when we call `perimeter`, it doesn\'t refer to the shape object, but to its surrounding scope (window for example). There is no value `radius` on that object, which returns `undefined`. @@ -5093,12 +5093,9 @@ const mouse = { }; ``` -- A: `mouse.bird.size` is not valid -- B: `mouse[bird.size]` is not valid -- C: `mouse[bird["size"]]` is not valid -- D: All of them are valid +
Answer -**Answer: A** +**Answer:** In JavaScript, all object keys are strings (unless it's a Symbol). Even though we might not _type_ them as strings, they are always converted into strings under the hood. @@ -5106,7 +5103,9 @@ JavaScript interprets (or unboxes) statements. When we use bracket notation, it `mouse[bird.size]`: First it evaluates `bird.size`, which is `"small"`. `mouse["small"]` returns `true` -However, with dot notation, this doesn't happen. `mouse` does not have a key called `bird`, which means that `mouse.bird` is `undefined`. Then, we ask for the `size` using dot notation: `mouse.bird.size`. Since `mouse.bird` is `undefined`, we're actually asking `undefined.size`. This isn't valid, and will throw an error similar to `Cannot read property "size" of undefined`. +However, with dot notation, this doesn\'t happen. `mouse` does not have a key called `bird`, which means that `mouse.bird` is `undefined`. Then, we ask for the `size` using dot notation: `mouse.bird.size`. Since `mouse.bird` is `undefined`, we're actually asking `undefined.size`. This isn\'t valid, and will throw an error similar to `Cannot read property "size" of undefined`. + +
↥ back to top @@ -5123,13 +5122,9 @@ c.greeting = "Hello"; console.log(d.greeting); ``` -- A: `Hello` -- B: `Hey!` -- C: `undefined` -- D: `ReferenceError` -- E: `TypeError` +
Answer -**Answer: A** +**Answer:** In JavaScript, all objects interact by _reference_ when setting them equal to each other. @@ -5139,6 +5134,8 @@ First, variable `c` holds a value to an object. Later, we assign `d` with the sa When you change one object, you change all of them. +
+ @@ -5155,12 +5152,9 @@ console.log(a === b); console.log(b === c); ``` -- A: `true` `false` `true` -- B: `false` `false` `true` -- C: `true` `false` `false` -- D: `false` `true` `true` +
Answer -**Answer: C** +**Answer:** `new Number()` is a built-in function constructor. Although it looks like a number, it's not really a number: it has a bunch of extra features and is an object. @@ -5168,6 +5162,8 @@ When we use the `==` operator, it only checks whether it has the same _value_. T However, when we use the `===` operator, both value _and_ type should be the same. It's not: `new Number()` is not a number, it's an **object**. Both return `false.` +
+ @@ -5190,15 +5186,14 @@ const freddie = new Chameleon({ newColor: "purple" }); console.log(freddie.colorChange("orange")); ``` -- A: `orange` -- B: `purple` -- C: `green` -- D: `TypeError` +
Answer -**Answer: D** +**Answer:** The `colorChange` function is static. Static methods are designed to live only on the constructor in which they are created, and cannot be passed down to any children. Since `freddie` is a child, the function is not passed down, and not available on the `freddie` instance: a `TypeError` is thrown. +
+ @@ -5211,16 +5206,16 @@ greetign = {}; // Typo! console.log(greetign); ``` -- A: `{}` -- B: `ReferenceError: greetign is not defined` -- C: `undefined` +
Answer -**Answer: A** +**Answer:** It logs the object, because we just created an empty object on the global object! When we mistyped `greeting` as `greetign`, the JS interpreter actually saw this as `global.greetign = {}` (or `window.greetign = {}` in a browser). In order to avoid this, we can use `"use strict"`. This makes sure that you have declared a variable before setting it equal to anything. +
+ @@ -5235,16 +5230,15 @@ function bark() { bark.animal = "dog"; ``` -- A: Nothing, this is totally fine! -- B: `SyntaxError`. You cannot add properties to a function this way. -- C: `"Woof"` gets logged. -- D: `ReferenceError` +
Answer -**Answer: A** +**Answer:** This is possible in JavaScript, because functions are objects! (Everything besides primitive types are objects) -A function is a special type of object. The code you write yourself isn't the actual function. The function is an object with properties. This property is invocable. +A function is a special type of object. The code you write yourself isn\'t the actual function. The function is an object with properties. This property is invocable. + +
↥ back to top @@ -5266,14 +5260,11 @@ Person.getFullName = function () { console.log(member.getFullName()); ``` -- A: `TypeError` -- B: `SyntaxError` -- C: `Lydia Hallie` -- D: `undefined` `undefined` +
Answer -**Answer: A** +**Answer:** -You can't add properties to a constructor like you can with regular objects. If you want to add a feature to all objects at once, you have to use the prototype instead. So in this case, +You can\'t add properties to a constructor like you can with regular objects. If you want to add a feature to all objects at once, you have to use the prototype instead. So in this case, ```js Person.prototype.getFullName = function () { @@ -5283,6 +5274,8 @@ Person.prototype.getFullName = function () { would have made `member.getFullName()` work. Why is this beneficial? Say that we added this method to the constructor itself. Maybe not every `Person` instance needed this method. This would waste a lot of memory space, since they would still have that property, which takes of memory space for each instance. Instead, if we only add it to the prototype, we just have it at one spot in memory, yet they all have access to it! +
+ @@ -5309,9 +5302,9 @@ console.log(sarah); **Answer: A** -For `sarah`, we didn't use the `new` keyword. When using `new`, it refers to the new empty object we create. However, if you don't add `new` it refers to the **global object**! +For `sarah`, we didn\'t use the `new` keyword. When using `new`, it refers to the new empty object we create. However, if you don\'t add `new` it refers to the **global object**! -We said that `this.firstName` equals `"Sarah"` and `this.lastName` equals `"Smith"`. What we actually did, is defining `global.firstName = 'Sarah'` and `global.lastName = 'Smith'`. `sarah` itself is left `undefined`, since we don't return a value from the `Person` function. +We said that `this.firstName` equals `"Sarah"` and `this.lastName` equals `"Smith"`. What we actually did, is defining `global.firstName = 'Sarah'` and `global.lastName = 'Smith'`. `sarah` itself is left `undefined`, since we don\'t return a value from the `Person` function.
↥ back to top @@ -5341,7 +5334,7 @@ During the **capturing** phase, the event goes through the ancestor elements dow **Answer: B** -All objects have prototypes, except for the **base object**. The base object is the object created by the user, or an object that is created using the `new` keyword. The base object has access to some methods and properties, such as `.toString`. This is the reason why you can use built-in JavaScript methods! All of such methods are available on the prototype. Although JavaScript can't find it directly on your object, it goes down the prototype chain and finds it there, which makes it accessible for you. +All objects have prototypes, except for the **base object**. The base object is the object created by the user, or an object that is created using the `new` keyword. The base object has access to some methods and properties, such as `.toString`. This is the reason why you can use built-in JavaScript methods! All of such methods are available on the prototype. Although JavaScript can\'t find it directly on your object, it goes down the prototype chain and finds it there, which makes it accessible for you.
↥ back to top @@ -5364,7 +5357,7 @@ sum(1, "2"); **Answer: C** -JavaScript is a **dynamically typed language**: we don't specify what types certain variables are. Values can automatically be converted into another type without you knowing, which is called _implicit type coercion_. **Coercion** is converting from one type into another. +JavaScript is a **dynamically typed language**: we don\'t specify what types certain variables are. Values can automatically be converted into another type without you knowing, which is called _implicit type coercion_. **Coercion** is converting from one type into another. In this example, JavaScript converts the number `1` into a string, in order for the function to make sense and return a value. During the addition of a numeric type (`1`) and a string type (`'2'`), the number is treated as a string. We can concatenate strings like `"Hello" + "World"`, so What is happening here is `"1" + "2"` which returns `"12"`. @@ -5440,7 +5433,7 @@ function checkAge(data) { } else if (data == { age: 18 }) { console.log("You are still an adult."); } else { - console.log(`Hmm.. You don't have an age I guess`); + console.log(`Hmm.. You don\'t have an age I guess`); } } @@ -5449,13 +5442,13 @@ checkAge({ age: 18 }); - A: `You are an adult!` - B: `You are still an adult.` -- C: `Hmm.. You don't have an age I guess` +- C: `Hmm.. You don\'t have an age I guess` **Answer: C** When testing equality, primitives are compared by their _value_, while objects are compared by their _reference_. JavaScript checks if the objects have a reference to the same location in memory. -The two objects that we are comparing don't have that: the object we passed as a parameter refers to a different location in memory than the object we used in order to check equality. +The two objects that we are comparing don\'t have that: the object we passed as a parameter refers to a different location in memory than the object we used in order to check equality. This is why both `{ age: 18 } === { age: 18 }` and `{ age: 18 } == { age: 18 }` return `false`. @@ -5505,7 +5498,7 @@ getAge(); **Answer: C** -With `"use strict"`, you can make sure that you don't accidentally declare global variables. We never declared the variable `age`, and since we use `"use strict"`, it will throw a reference error. If we didn't use `"use strict"`, it would have worked, since the property `age` would have gotten added to the global object. +With `"use strict"`, you can make sure that you don\'t accidentally declare global variables. We never declared the variable `age`, and since we use `"use strict"`, it will throw a reference error. If we didn\'t use `"use strict"`, it would have worked, since the property `age` would have gotten added to the global object.
↥ back to top @@ -5536,7 +5529,7 @@ const sum = eval("10*10+5"); sessionStorage.setItem("cool_secret", 123); ``` -- A: Forever, the data doesn't get lost. +- A: Forever, the data doesn\'t get lost. - B: When the user closes the tab. - C: When the user closes the entire browser, not only the tab. - D: When the user shuts off their computer. @@ -5593,9 +5586,9 @@ set.has(1); **Answer: C** -All object keys (excluding Symbols) are strings under the hood, even if you don't type it yourself as a string. This is why `obj.hasOwnProperty('1')` also returns true. +All object keys (excluding Symbols) are strings under the hood, even if you don\'t type it yourself as a string. This is why `obj.hasOwnProperty('1')` also returns true. -It doesn't work that way for a set. There is no `'1'` in our set: `set.has('1')` returns `false`. It has the numeric type `1`, `set.has(1)` returns `true`. +It doesn\'t work that way for a set. There is no `'1'` in our set: `set.has('1')` returns `false`. It has the numeric type `1`, `set.has(1)` returns `true`.
↥ back to top @@ -5733,7 +5726,7 @@ baz(); We have a `setTimeout` function and invoked it first. Yet, it was logged last. -This is because in browsers, we don't just have the runtime engine, we also have something called a `WebAPI`. The `WebAPI` gives us the `setTimeout` function to start with, and for example the DOM. +This is because in browsers, we don\'t just have the runtime engine, we also have something called a `WebAPI`. The `WebAPI` gives us the `setTimeout` function to start with, and for example the DOM. After the _callback_ is pushed to the WebAPI, the `setTimeout` function itself (but not the callback!) is popped off the stack. @@ -5747,7 +5740,7 @@ Now, `foo` gets invoked, and `"First"` is being logged. -The WebAPI can't just add stuff to the stack whenever it's ready. Instead, it pushes the callback function to something called the _queue_. +The WebAPI can\'t just add stuff to the stack whenever it's ready. Instead, it pushes the callback function to something called the _queue_. @@ -6159,7 +6152,7 @@ First, we declare a variable `person` with the value of an object that has a `na -Then, we declare a variable called `members`. We set the first element of that array equal to the value of the `person` variable. Objects interact by _reference_ when setting them equal to each other. When you assign a reference from one variable to another, you make a _copy_ of that reference. (note that they don't have the _same_ reference!) +Then, we declare a variable called `members`. We set the first element of that array equal to the value of the `person` variable. Objects interact by _reference_ when setting them equal to each other. When you assign a reference from one variable to another, you make a _copy_ of that reference. (note that they don\'t have the _same_ reference!) @@ -6235,7 +6228,7 @@ const num = parseInt("7*6", 10); **Answer: C** -Only the first numbers in the string is returned. Based on the _radix_ (the second argument in order to specify what type of number we want to parse it to: base 10, hexadecimal, octal, binary, etc.), the `parseInt` checks whether the characters in the string are valid. Once it encounters a character that isn't a valid number in the radix, it stops parsing and ignores the following characters. +Only the first numbers in the string is returned. Based on the _radix_ (the second argument in order to specify what type of number we want to parse it to: base 10, hexadecimal, octal, binary, etc.), the `parseInt` checks whether the characters in the string are valid. Once it encounters a character that isn\'t a valid number in the radix, it stops parsing and ignores the following characters. `*` is not a valid number. It only parses `"7"` into the decimal `7`. `num` now holds the value of `7`. @@ -6386,7 +6379,7 @@ let x = y; When we set `y` equal to `10`, we actually add a property `y` to the global object (`window` in browser, `global` in Node). In a browser, `window.y` is now equal to `10`. -Then, we declare a variable `x` with the value of `y`, which is `10`. Variables declared with the `let` keyword are _block scoped_, they are only defined within the block they're declared in; the immediately-invoked function (IIFE) in this case. When we use the `typeof` operator, the operand `x` is not defined: we are trying to access `x` outside of the block it's declared in. This means that `x` is not defined. Values who haven't been assigned a value or declared are of type `"undefined"`. `console.log(typeof x)` returns `"undefined"`. +Then, we declare a variable `x` with the value of `y`, which is `10`. Variables declared with the `let` keyword are _block scoped_, they are only defined within the block they're declared in; the immediately-invoked function (IIFE) in this case. When we use the `typeof` operator, the operand `x` is not defined: we are trying to access `x` outside of the block it's declared in. This means that `x` is not defined. Values who haven\'t been assigned a value or declared are of type `"undefined"`. `console.log(typeof x)` returns `"undefined"`. However, we created a global variable `y` when setting `y` equal to `10`. This value is accessible anywhere in our code. `y` is defined, and holds a value of type `"number"`. `console.log(typeof y)` returns `"number"`. @@ -6708,13 +6701,13 @@ The first argument that the `reduce` method receives is the _accumulator_, `x` i In this example, we are not returning any values, we are simply logging the values of the accumulator and the current value. -The value of the accumulator is equal to the previously returned value of the callback function. If you don't pass the optional `initialValue` argument to the `reduce` method, the accumulator is equal to the first element on the first call. +The value of the accumulator is equal to the previously returned value of the callback function. If you don\'t pass the optional `initialValue` argument to the `reduce` method, the accumulator is equal to the first element on the first call. -On the first call, the accumulator (`x`) is `1`, and the current value (`y`) is `2`. We don't return from the callback function, we log the accumulator and current value: `1` and `2` get logged. +On the first call, the accumulator (`x`) is `1`, and the current value (`y`) is `2`. We don\'t return from the callback function, we log the accumulator and current value: `1` and `2` get logged. -If you don't return a value from a function, it returns `undefined`. On the next call, the accumulator is `undefined`, and the current value is `3`. `undefined` and `3` get logged. +If you don\'t return a value from a function, it returns `undefined`. On the next call, the accumulator is `undefined`, and the current value is `3`. `undefined` and `3` get logged. -On the fourth call, we again don't return from the callback function. The accumulator is again `undefined`, and the current value is `4`. `undefined` and `4` get logged. +On the fourth call, we again don\'t return from the callback function. The accumulator is again `undefined`, and the current value is `4`. `undefined` and `4` get logged.

@@ -7093,7 +7086,7 @@ The `add` function is a _memoized_ function. With memoization, we can cache the If we call the `addFunction` function again with the same argument, it first checks whether it has already gotten that value in its cache. If that's the case, the caches value will be returned, which saves on execution time. Else, if it's not cached, it will calculate the value and store it afterwards. -We call the `addFunction` function three times with the same value: on the first invocation, the value of the function when `num` is equal to `10` isn't cached yet. The condition of the if-statement `num in cache` returns `false`, and the else block gets executed: `Calculated! 20` gets logged, and the value of the result gets added to the cache object. `cache` now looks like `{ 10: 20 }`. +We call the `addFunction` function three times with the same value: on the first invocation, the value of the function when `num` is equal to `10` isn\'t cached yet. The condition of the if-statement `num in cache` returns `false`, and the else block gets executed: `Calculated! 20` gets logged, and the value of the result gets added to the cache object. `cache` now looks like `{ 10: 20 }`. The second time, the `cache` object contains the value that gets returned for `10`. The condition of the if-statement `num in cache` returns `true`, and `'From cache! 20'` gets logged. @@ -7175,13 +7168,13 @@ console.log(sayHi()); **Answer: B** -By default, arguments have the value of `undefined`, unless a value has been passed to the function. In this case, we didn't pass a value for the `name` argument. `name` is equal to `undefined` which gets logged. +By default, arguments have the value of `undefined`, unless a value has been passed to the function. In this case, we didn\'t pass a value for the `name` argument. `name` is equal to `undefined` which gets logged. In ES6, we can overwrite this default `undefined` value with default parameters. For example: `function sayHi(name = "Lydia") { ... }` -In this case, if we didn't pass a value or if we passed `undefined`, `name` would always be equal to the string `Lydia` +In this case, if we didn\'t pass a value or if we passed `undefined`, `name` would always be equal to the string `Lydia`
↥ back to top @@ -7247,7 +7240,7 @@ We set the variable `city` equal to the value of the property called `city` on t Note that we are _not_ referencing the `person` object itself! We simply set the variable `city` equal to the current value of the `city` property on the `person` object. -Then, we set `city` equal to the string `"Amsterdam"`. This doesn't change the person object: there is no reference to that object. +Then, we set `city` equal to the string `"Amsterdam"`. This doesn\'t change the person object: there is no reference to that object. When logging the `person` object, the unmodified object gets returned. @@ -7372,7 +7365,7 @@ sum(10); You can set a default parameter's value equal to another parameter of the function, as long as they've been defined _before_ the default parameter. We pass the value `10` to the `sum` function. If the `sum` function only receives 1 argument, it means that the value for `num2` is not passed, and the value of `num1` is equal to the passed value `10` in this case. The default value of `num2` is the value of `num1`, which is `10`. `num1 + num2` returns `20`. -If you're trying to set a default parameter's value equal to a parameter which is defined _after_ (to the right), the parameter's value hasn't been initialized yet, which will throw an error. +If you're trying to set a default parameter's value equal to a parameter which is defined _after_ (to the right), the parameter's value hasn\'t been initialized yet, which will throw an error.
↥ back to top @@ -7577,9 +7570,9 @@ console.log(nums(1, 2)); **Answer: B** -In JavaScript, we don't _have_ to write the semicolon (`;`) explicitly, however the JavaScript engine still adds them after statements. This is called **Automatic Semicolon Insertion**. A statement can for example be variables, or keywords like `throw`, `return`, `break`, etc. +In JavaScript, we don\'t _have_ to write the semicolon (`;`) explicitly, however the JavaScript engine still adds them after statements. This is called **Automatic Semicolon Insertion**. A statement can for example be variables, or keywords like `throw`, `return`, `break`, etc. -Here, we wrote a `return` statement, and another value `a + b` on a _new line_. However, since it's a new line, the engine doesn't know that it's actually the value that we wanted to return. Instead, it automatically added a semicolon after `return`. You could see this as: +Here, we wrote a `return` statement, and another value `a + b` on a _new line_. However, since it's a new line, the engine doesn\'t know that it's actually the value that we wanted to return. Instead, it automatically added a semicolon after `return`. You could see this as: ```javascript return; @@ -7642,7 +7635,7 @@ console.log(Object.keys(info)); **Answer: D** -A Symbol is not _enumerable_. The Object.keys method returns all _enumerable_ key properties on an object. The Symbol won't be visible, and an empty array is returned. When logging the entire object, all properties will be visible, even non-enumerable ones. +A Symbol is not _enumerable_. The Object.keys method returns all _enumerable_ key properties on an object. The Symbol won\'t be visible, and an empty array is returned. When logging the entire object, all properties will be visible, even non-enumerable ones. This is one of the many qualities of a symbol: besides representing an entirely unique value (which prevents accidental name collision on objects, for example when working with 2 libraries that want to add properties to the same object), you can also "hide" properties on objects this way (although not entirely. You can still access symbols using the `Object.getOwnPropertySymbols()` method). @@ -7676,7 +7669,7 @@ The `getList` function receives an array as its argument. Between the parenthese With the rest parameter `...y`, we put all "remaining" arguments in an array. The remaining arguments are `2`, `3` and `4` in this case. The value of `y` is an array, containing all the rest parameters. The value of `x` is equal to `1` in this case, so when we log `[x, y]`, `[1, [2, 3, 4]]` gets logged. -The `getUser` function receives an object. With arrow functions, we don't _have_ to write curly brackets if we just return one value. However, if you want to return an _object_ from an arrow function, you have to write it between parentheses, otherwise no value gets returned! The following function would have returned an object: +The `getUser` function receives an object. With arrow functions, we don\'t _have_ to write curly brackets if we just return one value. However, if you want to return an _object_ from an arrow function, you have to write it between parentheses, otherwise no value gets returned! The following function would have returned an object: `const getUser = user => ({ name: user.name, age: user.age })` @@ -7705,8 +7698,8 @@ The variable `name` holds the value of a string, which is not a function, thus c TypeErrors get thrown when a value is not of the expected type. JavaScript expected `name` to be a function since we're trying to invoke it. It was a string however, so a TypeError gets thrown: name is not a function! -SyntaxErrors get thrown when you've written something that isn't valid JavaScript, for example when you've written the word `return` as `retrun`. -ReferenceErrors get thrown when JavaScript isn't able to find a reference to a value that you're trying to access. +SyntaxErrors get thrown when you've written something that isn\'t valid JavaScript, for example when you've written the word `return` as `retrun`. +ReferenceErrors get thrown when JavaScript isn\'t able to find a reference to a value that you're trying to access.
↥ back to top @@ -7723,14 +7716,14 @@ You should${"" && `n't`} see a therapist after so much JavaScript lol`; - A: `possible! You should see a therapist after so much JavaScript lol` - B: `Impossible! You should see a therapist after so much JavaScript lol` -- C: `possible! You shouldn't see a therapist after so much JavaScript lol` -- D: `Impossible! You shouldn't see a therapist after so much JavaScript lol` +- C: `possible! You shouldn\'t see a therapist after so much JavaScript lol` +- D: `Impossible! You shouldn\'t see a therapist after so much JavaScript lol` **Answer: B** `[]` is a truthy value. With the `&&` operator, the right-hand value will be returned if the left-hand value is a truthy value. In this case, the left-hand value `[]` is a truthy value, so `"Im'` gets returned. -`""` is a falsy value. If the left-hand value is falsy, nothing gets returned. `n't` doesn't get returned. +`""` is a falsy value. If the left-hand value is falsy, nothing gets returned. `n\'t` doesn\'t get returned.
↥ back to top @@ -7994,7 +7987,7 @@ We set the value of the `favoriteFood` property on the `info` object equal to th In JavaScript, primitive data types (everything that's not an object) interact by _value_. In this case, we set the value of the `favoriteFood` property on the `info` object equal to the value of the first element in the `food` array, the string with the pizza emoji in this case (`'🍕'`). A string is a primitive data type, and interact by value (see my [blogpost](https://www.theavocoder.com/complete-javascript/2018/12/21/by-value-vs-by-reference) if you're interested in learning more) -Then, we change the value of the `favoriteFood` property on the `info` object. The `food` array hasn't changed, since the value of `favoriteFood` was merely a _copy_ of the value of the first element in the array, and doesn't have a reference to the same spot in memory as the element on `food[0]`. When we log food, it's still the original array, `['🍕', '🍫', '🥑', '🍔']`. +Then, we change the value of the `favoriteFood` property on the `info` object. The `food` array hasn\'t changed, since the value of `favoriteFood` was merely a _copy_ of the value of the first element in the array, and doesn\'t have a reference to the same spot in memory as the element on `food[0]`. When we log food, it's still the original array, `['🍕', '🍫', '🥑', '🍔']`.
↥ back to top @@ -8055,9 +8048,9 @@ getName(); Each function has its own _execution context_ (or _scope_). The `getName` function first looks within its own context (scope) to see if it contains the variable `name` we're trying to access. In this case, the `getName` function contains its own `name` variable: we declare the variable `name` with the `let` keyword, and with the value of `'Sarah'`. -Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don't get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`. +Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don\'t get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`. -If we wouldn't have declared the `name` variable within the `getName` function, the javascript engine would've looked down the _scope chain_. The outer scope has a variable called `name` with the value of `Lydia`. In that case, it would've logged `Lydia`. +If we wouldn\'t have declared the `name` variable within the `getName` function, the javascript engine would've looked down the _scope chain_. The outer scope has a variable called `name` with the value of `Lydia`. In that case, it would've logged `Lydia`. ```javascript let name = "Lydia"; @@ -8151,14 +8144,14 @@ let config = { config = null; ``` -- A: The `setInterval` callback won't be invoked +- A: The `setInterval` callback won\'t be invoked - B: The `setInterval` callback gets invoked once - C: The `setInterval` callback will still be called every second - D: We never invoked `config.alert()`, config is `null` **Answer: C** -Normally when we set objects equal to `null`, those objects get _garbage collected_ as there is no reference anymore to that object. However, since the callback function within `setInterval` is an arrow function (thus bound to the `config` object), the callback function still holds a reference to the `config` object. As long as there is a reference, the object won't get garbage collected. Since it's not garbage collected, the `setInterval` callback function will still get invoked every 1000ms (1s). +Normally when we set objects equal to `null`, those objects get _garbage collected_ as there is no reference anymore to that object. However, since the callback function within `setInterval` is an arrow function (thus bound to the `config` object), the callback function still holds a reference to the `config` object. As long as there is a reference, the object won\'t get garbage collected. Since it's not garbage collected, the `setInterval` callback function will still get invoked every 1000ms (1s).
↥ back to top @@ -8227,7 +8220,7 @@ Both the `changeAge` and `changeAgeAndName` functions have a default parameter, First, we invoke the `changeAge` function and pass the `person` object as its argument. This function increases the value of the `age` property by 1. `person` is now `{ name: "Lydia", age: 22 }`. -Then, we invoke the `changeAgeAndName` function, however we don't pass a parameter. Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it's a new object, it doesn't affect the values of the properties on the `person` object. `person` is still equal to `{ name: "Lydia", age: 22 }`. +Then, we invoke the `changeAgeAndName` function, however we don\'t pass a parameter. Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it's a new object, it doesn\'t affect the values of the properties on the `person` object. `person` is still equal to `{ name: "Lydia", age: 22 }`.
↥ back to top From ba7d28118e1fc30b1c573f248eab7cb796bfc61a Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 23 Oct 2022 12:15:57 +0530 Subject: [PATCH 030/117] Update README.md --- README.md | 335 ++++++++++++++++++++++-------------------------------- 1 file changed, 138 insertions(+), 197 deletions(-) diff --git a/README.md b/README.md index 434b87c..772df7d 100644 --- a/README.md +++ b/README.md @@ -5295,17 +5295,16 @@ console.log(lydia); console.log(sarah); ``` -- A: `Person {firstName: "Lydia", lastName: "Hallie"}` and `undefined` -- B: `Person {firstName: "Lydia", lastName: "Hallie"}` and `Person {firstName: "Sarah", lastName: "Smith"}` -- C: `Person {firstName: "Lydia", lastName: "Hallie"}` and `{}` -- D:`Person {firstName: "Lydia", lastName: "Hallie"}` and `ReferenceError` +
Answer -**Answer: A** +**Answer:** For `sarah`, we didn\'t use the `new` keyword. When using `new`, it refers to the new empty object we create. However, if you don\'t add `new` it refers to the **global object**! We said that `this.firstName` equals `"Sarah"` and `this.lastName` equals `"Smith"`. What we actually did, is defining `global.firstName = 'Sarah'` and `global.lastName = 'Smith'`. `sarah` itself is left `undefined`, since we don\'t return a value from the `Person` function. +
+ @@ -5317,25 +5316,33 @@ We said that `this.firstName` equals `"Sarah"` and `this.lastName` equals `"Smit - C: Target > Bubbling > Capturing - D: Capturing > Target > Bubbling +
Answer + **Answer: D** During the **capturing** phase, the event goes through the ancestor elements down to the target element. It then reaches the **target** element, and **bubbling** begins. +
+ -## Q. All object have prototypes. +## Q. All object have prototypes? - A: true - B: false +
Answer + **Answer: B** All objects have prototypes, except for the **base object**. The base object is the object created by the user, or an object that is created using the `new` keyword. The base object has access to some methods and properties, such as `.toString`. This is the reason why you can use built-in JavaScript methods! All of such methods are available on the prototype. Although JavaScript can\'t find it directly on your object, it goes down the prototype chain and finds it there, which makes it accessible for you. +
+ @@ -5350,17 +5357,16 @@ function sum(a, b) { sum(1, "2"); ``` -- A: `NaN` -- B: `TypeError` -- C: `"12"` -- D: `3` +
Answer -**Answer: C** +**Answer:** JavaScript is a **dynamically typed language**: we don\'t specify what types certain variables are. Values can automatically be converted into another type without you knowing, which is called _implicit type coercion_. **Coercion** is converting from one type into another. In this example, JavaScript converts the number `1` into a string, in order for the function to make sense and return a value. During the addition of a numeric type (`1`) and a string type (`'2'`), the number is treated as a string. We can concatenate strings like `"Hello" + "World"`, so What is happening here is `"1" + "2"` which returns `"12"`. +
+ @@ -5374,12 +5380,9 @@ console.log(++number); console.log(number); ``` -- A: `1` `1` `2` -- B: `1` `2` `2` -- C: `0` `2` `2` -- D: `0` `1` `2` +
Answer -**Answer: C** +**Answer:** The **postfix** unary operator `++`: @@ -5393,6 +5396,8 @@ The **prefix** unary operator `++`: This returns `0 2 2`. +
+ @@ -5412,14 +5417,14 @@ const age = 21; getPersonInfo`${person} is ${age} years old`; ``` -- A: `"Lydia"` `21` `["", " is ", " years old"]` -- B: `["", " is ", " years old"]` `"Lydia"` `21` -- C: `"Lydia"` `["", " is ", " years old"]` `21` +
Answer -**Answer: B** +**Answer:** If you use tagged template literals, the value of the first argument is always an array of the string values. The remaining arguments get the values of the passed expressions! +
+ @@ -5440,11 +5445,9 @@ function checkAge(data) { checkAge({ age: 18 }); ``` -- A: `You are an adult!` -- B: `You are still an adult.` -- C: `Hmm.. You don\'t have an age I guess` +
Answer -**Answer: C** +**Answer:** When testing equality, primitives are compared by their _value_, while objects are compared by their _reference_. JavaScript checks if the objects have a reference to the same location in memory. @@ -5452,6 +5455,8 @@ The two objects that we are comparing don\'t have that: the object we passed as This is why both `{ age: 18 } === { age: 18 }` and `{ age: 18 } == { age: 18 }` return `false`. +
+ @@ -5466,15 +5471,14 @@ function getAge(...args) { getAge(21); ``` -- A: `"number"` -- B: `"array"` -- C: `"object"` -- D: `"NaN"` +
Answer -**Answer: C** +**Answer:** The rest parameter (`...args`.) lets us "collect" all remaining arguments into an array. An array is an object, so `typeof args` returns `"object"` +
+ @@ -5491,15 +5495,14 @@ function getAge() { getAge(); ``` -- A: `21` -- B: `undefined` -- C: `ReferenceError` -- D: `TypeError` +
Answer -**Answer: C** +**Answer:** With `"use strict"`, you can make sure that you don\'t accidentally declare global variables. We never declared the variable `age`, and since we use `"use strict"`, it will throw a reference error. If we didn\'t use `"use strict"`, it would have worked, since the property `age` would have gotten added to the global object. +
+ @@ -5510,15 +5513,14 @@ With `"use strict"`, you can make sure that you don\'t accidentally declare glob const sum = eval("10*10+5"); ``` -- A: `105` -- B: `"105"` -- C: `TypeError` -- D: `"10*10+5"` +
Answer -**Answer: A** +**Answer:** `eval` evaluates codes that's passed as a string. If it's an expression, like in this case, it evaluates the expression. The expression is `10 * 10 + 5`. This returns the number `105`. +
+ @@ -5529,17 +5531,16 @@ const sum = eval("10*10+5"); sessionStorage.setItem("cool_secret", 123); ``` -- A: Forever, the data doesn\'t get lost. -- B: When the user closes the tab. -- C: When the user closes the entire browser, not only the tab. -- D: When the user shuts off their computer. +
Answer -**Answer: B** +**Answer:** The data stored in `sessionStorage` is removed after closing the _tab_. If you used `localStorage`, the data would've been there forever, unless for example `localStorage.clear()` is invoked. +
+ @@ -5553,16 +5554,15 @@ var num = 10; console.log(num); ``` -- A: `8` -- B: `10` -- C: `SyntaxError` -- D: `ReferenceError` +
Answer -**Answer: B** +**Answer:** With the `var` keyword, you can declare multiple variables with the same name. The variable will then hold the latest value. You cannot do this with `let` or `const` since they're block-scoped. +
+ @@ -5579,17 +5579,16 @@ set.has("1"); set.has(1); ``` -- A: `false` `true` `false` `true` -- B: `false` `true` `true` `true` -- C: `true` `true` `false` `true` -- D: `true` `true` `true` `true` +
Answer -**Answer: C** +**Answer:** All object keys (excluding Symbols) are strings under the hood, even if you don\'t type it yourself as a string. This is why `obj.hasOwnProperty('1')` also returns true. It doesn\'t work that way for a set. There is no `'1'` in our set: `set.has('1')` returns `false`. It has the numeric type `1`, `set.has(1)` returns `true`. +
+ @@ -5601,15 +5600,14 @@ const obj = { a: "one", b: "two", a: "three" }; console.log(obj); ``` -- A: `{ a: "one", b: "two" }` -- B: `{ b: "two", a: "three" }` -- C: `{ a: "three", b: "two" }` -- D: `SyntaxError` +
Answer -**Answer: C** +**Answer:** If you have two keys with the same name, the key will be replaced. It will still be in its first position, but with the last specified value. +
+ @@ -5620,10 +5618,14 @@ If you have two keys with the same name, the key will be replaced. It will still - B: false - C: it depends +
Answer + **Answer: A** The base execution context is the global execution context: it's What is accessible everywhere in your code. +
+ @@ -5637,15 +5639,14 @@ for (let i = 1; i < 5; i++) { } ``` -- A: `1` `2` -- B: `1` `2` `3` -- C: `1` `2` `4` -- D: `1` `3` `4` +
Answer -**Answer: C** +**Answer:** The `continue` statement skips an iteration if a certain condition returns `true`. +
+ @@ -5662,15 +5663,14 @@ const name = "Lydia"; name.giveLydiaPizza(); ``` -- A: `"Just give Lydia pizza already!"` -- B: `TypeError: not a function` -- C: `SyntaxError` -- D: `undefined` +
Answer -**Answer: A** +**Answer:** `String` is a built-in constructor, which we can add properties to. I just added a method to its prototype. Primitive strings are automatically converted into a string object, generated by the string prototype function. So, all strings (string objects) have access to that method! +
+ @@ -5688,12 +5688,9 @@ a[c] = 456; console.log(a[b]); ``` -- A: `123` -- B: `456` -- C: `undefined` -- D: `ReferenceError` +
Answer -**Answer: B** +**Answer:** Object keys are automatically converted into strings. We are trying to set an object as a key to object `a`, with the value of `123`. @@ -5701,6 +5698,8 @@ However, when we stringify an object, it becomes `"[Object object]"`. So what we Then, we log `a[b]`, which is actually `a["Object object"]`. We just set that to `456`, so it returns `456`. +
+ @@ -5717,12 +5716,7 @@ foo(); baz(); ``` -- A: `First` `Second` `Third` -- B: `First` `Third` `Second` -- C: `Second` `First` `Third` -- D: `Second` `Third` `First` - -**Answer: B** +
Answer We have a `setTimeout` function and invoked it first. Yet, it was logged last. @@ -5750,6 +5744,8 @@ This is where an event loop starts to work. An **event loop** looks at the stack `bar` gets invoked, `"Second"` gets logged, and it's popped off the stack. +
+ @@ -5764,15 +5760,12 @@ This is where an event loop starts to work. An **event loop** looks at the stack
``` -- A: Outer `div` -- B: Inner `div` -- C: `button` -- D: An array of all nested elements. - -**Answer: C** +
Answer The deepest nested element that caused the event is the target of the event. You can stop bubbling by `event.stopPropagation` +
+ @@ -5785,15 +5778,12 @@ The deepest nested element that caused the event is the target of the event. You
``` -- A: `p` `div` -- B: `div` `p` -- C: `p` -- D: `div` - -**Answer: A** +
Answer If we click `p`, we see two logs: `p` and `div`. During event propagation, there are 3 phases: capturing, target, and bubbling. By default, event handlers are executed in the bubbling phase (unless you set `useCapture` to `true`). It goes from the deepest nested element outwards. +
+ @@ -5811,17 +5801,14 @@ sayHi.call(person, 21); sayHi.bind(person, 21); ``` -- A: `undefined is 21` `Lydia is 21` -- B: `function` `function` -- C: `Lydia is 21` `Lydia is 21` -- D: `Lydia is 21` `function` - -**Answer: D** +
Answer With both, we can pass the object to which we want the `this` keyword to refer to. However, `.call` is also _executed immediately_! `.bind.` returns a _copy_ of the function, but with a bound context! It is not executed immediately. +
+ @@ -5836,17 +5823,14 @@ function sayHi() { console.log(typeof sayHi()); ``` -- A: `"object"` -- B: `"number"` -- C: `"function"` -- D: `"undefined"` - -**Answer: B** +
Answer The `sayHi` function returns the returned value of the immediately invoked function (IIFE). This function returned `0`, which is type `"number"`. FYI: there are only 7 built-in types: `null`, `undefined`, `boolean`, `number`, `string`, `object`, and `symbol`. `"function"` is not a type, since functions are objects, it's of type `"object"`. +
+ @@ -5862,12 +5846,7 @@ new Boolean(false); undefined; ``` -- A: `0`, `''`, `undefined` -- B: `0`, `new Number(0)`, `''`, `new Boolean(false)`, `undefined` -- C: `0`, `''`, `new Boolean(false)`, `undefined` -- D: All of them are falsy - -**Answer: A** +
Answer There are only six falsy values: @@ -5880,6 +5859,8 @@ There are only six falsy values: Function constructors, like `new Number` and `new Boolean` are truthy. +
+ @@ -5890,16 +5871,13 @@ Function constructors, like `new Number` and `new Boolean` are truthy. console.log(typeof typeof 1); ``` -- A: `"number"` -- B: `"string"` -- C: `"object"` -- D: `"undefined"` - -**Answer: B** +
Answer `typeof 1` returns `"number"`. `typeof "number"` returns `"string"` +
+ @@ -5912,12 +5890,7 @@ numbers[10] = 11; console.log(numbers); ``` -- A: `[1, 2, 3, 7 x null, 11]` -- B: `[1, 2, 3, 11]` -- C: `[1, 2, 3, 7 x empty, 11]` -- D: `SyntaxError` - -**Answer: C** +
Answer When you set a value to an element in an array that exceeds the length of the array, JavaScript creates something called "empty slots". These actually have the value of `undefined`, but you will see something like: @@ -5925,6 +5898,8 @@ When you set a value to an element in an array that exceeds the length of the ar depending on where you run it (it's different for every browser, node, etc.) +
+ @@ -5945,12 +5920,7 @@ depending on where you run it (it's different for every browser, node, etc.) })(); ``` -- A: `1` `undefined` `2` -- B: `undefined` `undefined` `undefined` -- C: `1` `1` `2` -- D: `1` `undefined` `undefined` - -**Answer: A** +
Answer The `catch` block receives the argument `x`. This is not the same `x` as the variable when we pass arguments. This variable `x` is block-scoped. @@ -5958,6 +5928,8 @@ Later, we set this block-scoped variable equal to `1`, and set the value of the Outside of the `catch` block, `x` is still `undefined`, and `y` is `2`. When we want to `console.log(x)` outside of the `catch` block, it returns `undefined`, and `y` returns `2`. +
+ @@ -5969,7 +5941,7 @@ Outside of the `catch` block, `x` is still `undefined`, and `y` is `2`. When we - C: trick question! only objects - D: number or object -**Answer: A** +
Answer JavaScript only has primitive types and objects. @@ -5977,6 +5949,8 @@ Primitive types are `boolean`, `null`, `undefined`, `bigint`, `number`, `string` What differentiates a primitive from an object is that primitives do not have any properties or methods; however, you'll note that `'foo'.toUpperCase()` evaluates to `'FOO'` and does not result in a `TypeError`. This is because when you try to access a property or method on a primitive like a string, JavaScript will implicitly wrap the object using one of the wrapper classes, i.e. `String`, and then immediately discard the wrapper after the expression evaluates. All primitives except for `null` and `undefined` exhibit this behaviour. +
+ @@ -5995,17 +5969,14 @@ What differentiates a primitive from an object is that primitives do not have an ); ``` -- A: `[0, 1, 2, 3, 1, 2]` -- B: `[6, 1, 2]` -- C: `[1, 2, 0, 1, 2, 3]` -- D: `[1, 2, 6]` - -**Answer: C** +
Answer `[1, 2]` is our initial value. This is the value we start with, and the value of the very first `acc`. During the first round, `acc` is `[1,2]`, and `cur` is `[0, 1]`. We concatenate them, which results in `[1, 2, 0, 1]`. Then, `[1, 2, 0, 1]` is `acc` and `[2, 3]` is `cur`. We concatenate them, and get `[1, 2, 0, 1, 2, 3]` +
+ @@ -6018,12 +5989,7 @@ Then, `[1, 2, 0, 1]` is `acc` and `[2, 3]` is `cur`. We concatenate them, and ge !!1; ``` -- A: `false` `true` `false` -- B: `false` `false` `true` -- C: `false` `true` `true` -- D: `true` `true` `false` - -**Answer: B** +
Answer `null` is falsy. `!null` returns `true`. `!true` returns `false`. @@ -6031,6 +5997,8 @@ Then, `[1, 2, 0, 1]` is `acc` and `[2, 3]` is `cur`. We concatenate them, and ge `1` is truthy. `!1` returns `false`. `!false` returns `true`. +
+ @@ -6041,15 +6009,12 @@ Then, `[1, 2, 0, 1]` is `acc` and `[2, 3]` is `cur`. We concatenate them, and ge setInterval(() => console.log("Hi"), 1000); ``` -- A: a unique id -- B: the amount of milliseconds specified -- C: the passed function -- D: `undefined` - -**Answer: A** +
Answer It returns a unique id. This id can be used to clear that interval with the `clearInterval()` function. +
+ @@ -6060,15 +6025,12 @@ It returns a unique id. This id can be used to clear that interval with the `cle [..."Lydia"]; ``` -- A: `["L", "y", "d", "i", "a"]` -- B: `["Lydia"]` -- C: `[[], "Lydia"]` -- D: `[["L", "y", "d", "i", "a"]]` - -**Answer: A** +
Answer A string is an iterable. The spread operator maps every character of an iterable to one element. +
+ @@ -6087,19 +6049,16 @@ console.log(gen.next().value); console.log(gen.next().value); ``` -- A: `[0, 10], [10, 20]` -- B: `20, 20` -- C: `10, 20` -- D: `0, 10 and 10, 20` - -**Answer: C** +
Answer -Regular functions cannot be stopped mid-way after invocation. However, a generator function can be "stopped" midway, and later continue from where it stopped. Every time a generator function encounters a `yield` keyword, the function yields the value specified after it. Note that the generator function in that case doesn’t _return_ the value, it _yields_ the value. +Regular functions cannot be stopped mid-way after invocation. However, a generator function can be "stopped" midway, and later continue from where it stopped. Every time a generator function encounters a `yield` keyword, the function yields the value specified after it. Note that the generator function in that case doesn\'t _return_ the value, it _yields_ the value. First, we initialize the generator function with `i` equal to `10`. We invoke the generator function using the `next()` method. The first time we invoke the generator function, `i` is equal to `10`. It encounters the first `yield` keyword: it yields the value of `i`. The generator is now "paused", and `10` gets logged. Then, we invoke the function again with the `next()` method. It starts to continue where it stopped previously, still with `i` equal to `10`. Now, it encounters the next `yield` keyword, and yields `i * 2`. `i` is equal to `10`, so it returns `10 * 2`, which is `20`. This results in `10, 20`. +
+ @@ -6118,15 +6077,12 @@ const secondPromise = new Promise((res, rej) => { Promise.race([firstPromise, secondPromise]).then((res) => console.log(res)); ``` -- A: `"one"` -- B: `"two"` -- C: `"two" "one"` -- D: `"one" "two"` - -**Answer: B** +
Answer When we pass multiple promises to the `Promise.race` method, it resolves/rejects the _first_ promise that resolves/rejects. To the `setTimeout` method, we pass a timer: 500ms for the first promise (`firstPromise`), and 100ms for the second promise (`secondPromise`). This means that the `secondPromise` resolves first with the value of `'two'`. `res` now holds the value of `'two'`, which gets logged. +
+ @@ -6141,12 +6097,7 @@ person = null; console.log(members); ``` -- A: `null` -- B: `[null]` -- C: `[{}]` -- D: `[{ name: "Lydia" }]` - -**Answer: D** +
Answer First, we declare a variable `person` with the value of an object that has a `name` property. @@ -6162,6 +6113,8 @@ Then, we set the variable `person` equal to `null`. We are only modifying the value of the `person` variable, and not the first element in the array, since that element has a different (copied) reference to the object. The first element in `members` still holds its reference to the original object. When we log the `members` array, the first element still holds the value of the object, which gets logged. +
+ @@ -6179,15 +6132,12 @@ for (const item in person) { } ``` -- A: `{ name: "Lydia" }, { age: 21 }` -- B: `"name", "age"` -- C: `"Lydia", 21` -- D: `["name", "Lydia"], ["age", 21]` - -**Answer: B** +
Answer With a `for-in` loop, we can iterate through object keys, in this case `name` and `age`. Under the hood, object keys are strings (if they're not a Symbol). On every loop, we set the value of `item` equal to the current key it’s iterating over. First, `item` is equal to `name`, and gets logged. Then, `item` is equal to `age`, which gets logged. +
+ @@ -6198,12 +6148,7 @@ With a `for-in` loop, we can iterate through object keys, in this case `name` an console.log(3 + 4 + "5"); ``` -- A: `"345"` -- B: `"75"` -- C: `12` -- D: `"12"` - -**Answer: B** +
Answer Operator associativity is the order in which the compiler evaluates the expressions, either left-to-right or right-to-left. This only happens if all operators have the _same_ precedence. We only have one type of operator: `+`. For addition, the associativity is left-to-right. @@ -6211,6 +6156,8 @@ Operator associativity is the order in which the compiler evaluates the expressi `7 + '5'` results in `"75"` because of coercion. JavaScript converts the number `7` into a string, see question 15. We can concatenate two strings using the `+`operator. `"7" + "5"` results in `"75"`. +
+ @@ -6221,17 +6168,14 @@ Operator associativity is the order in which the compiler evaluates the expressi const num = parseInt("7*6", 10); ``` -- A: `42` -- B: `"42"` -- C: `7` -- D: `NaN` - -**Answer: C** +
Answer Only the first numbers in the string is returned. Based on the _radix_ (the second argument in order to specify what type of number we want to parse it to: base 10, hexadecimal, octal, binary, etc.), the `parseInt` checks whether the characters in the string are valid. Once it encounters a character that isn\'t a valid number in the radix, it stops parsing and ignores the following characters. `*` is not a valid number. It only parses `"7"` into the decimal `7`. `num` now holds the value of `7`. +
+ @@ -6245,16 +6189,13 @@ Only the first numbers in the string is returned. Based on the _radix_ (the seco }); ``` -- A: `[]` -- B: `[null, null, null]` -- C: `[undefined, undefined, undefined]` -- D: `[ 3 x empty ]` - -**Answer: C** +
Answer When mapping over the array, the value of `num` is equal to the element it’s currently looping over. In this case, the elements are numbers, so the condition of the if statement `typeof num === "number"` returns `true`. The map function creates a new array and inserts the values returned from the function. -However, we don’t return a value. When we don’t return a value from the function, the function returns `undefined`. For every element in the array, the function block gets called, so for each element we return `undefined`. +However, we don\'t return a value. When we don\'t return a value from the function, the function returns `undefined`. For every element in the array, the function block gets called, so for each element we return `undefined`. + +
↥ back to top From 616662bd0ff3b314865ebe73372a4fcadfad1a3f Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 23 Oct 2022 12:21:27 +0530 Subject: [PATCH 031/117] Update README.md --- README.md | 176 ++++++++++++++++++++++-------------------------------- 1 file changed, 73 insertions(+), 103 deletions(-) diff --git a/README.md b/README.md index 772df7d..4f18acc 100644 --- a/README.md +++ b/README.md @@ -1260,7 +1260,7 @@ console.log( ↥ back to top
-## Q. Consecutive 1's in binary +## Q. Consecutive 1\'s in binary ```javascript function consecutiveOne(num) { @@ -1603,7 +1603,7 @@ function getPath(root, target) { return path; } -// Given a tree and a path, let's locate a node +// Given a tree and a path, let\'s locate a node function locateNodeFromPath(node, path) { return path.reduce((root, index) => root.childNodes[index], node); } @@ -1738,7 +1738,7 @@ Math.max.apply(Math, arr); // Slow ↥ back to top
-## Q. Move all zero's to end +## Q. Move all zero\'s to end ```javascript const moveZeroToEnd = (arr) => { @@ -2493,7 +2493,7 @@ console.log(output);
Answer -The code above will output `0` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **local variable**. `delete` operator doesn\'t affect local variables. +The code above will output `0` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it\'s **local variable**. `delete` operator doesn\'t affect local variables.
@@ -2515,7 +2515,7 @@ console.log(output);
Answer -The code above will output `1` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it's **global variable** of type `number`. +The code above will output `1` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it\'s **global variable** of type `number`.
@@ -2600,7 +2600,7 @@ console.log(bar + false);
Answer -The code above will output `1, "truexyz", 2, 1` as output. Here's a general guideline for the plus operator: +The code above will output `1, "truexyz", 2, 1` as output. Here\'s a general guideline for the plus operator: - Number + Number -> Addition - Boolean + Number -> Addition @@ -2770,7 +2770,7 @@ console.log(person); The output of above code would be `"USA"`. Here `new User("xyz")` creates a brand new object and created property `location` on that and `USA` has been assigned to object property location and that has been referenced by the person. -Let say `new User("xyz")` created a object called `foo`. The value `"USA"` will be assigned to `foo["location"]`, but according to [ECMAScript Specification](http://www.ecma-international.org/ecma-262/6.0/#sec-assignment-operators-runtime-semantics-evaluation) , pt 12.14.4 the assignment will itself return the rightmost value: in our case it's `"USA"`. +Let say `new User("xyz")` created a object called `foo`. The value `"USA"` will be assigned to `foo["location"]`, but according to [ECMAScript Specification](http://www.ecma-international.org/ecma-262/6.0/#sec-assignment-operators-runtime-semantics-evaluation) , pt 12.14.4 the assignment will itself return the rightmost value: in our case it\'s `"USA"`. Then it will be assigned to person. To better understand What is going on here, try to execute this code in console, line by line: @@ -2871,8 +2871,8 @@ console.log(arrA); The output will be `[42,1,2,3,4,5]`. Arrays are object in JavaScript and they are passed and assigned by reference. This is why -both `arrA` and `arrB` point to the same array `[0,1,2,3,4,5]`. That's why changing the first -element of the `arrB` will also modify `arrA`: it's the same array in the memory. +both `arrA` and `arrB` point to the same array `[0,1,2,3,4,5]`. That\'s why changing the first +element of the `arrB` will also modify `arrA`: it\'s the same array in the memory.
@@ -2893,7 +2893,7 @@ console.log(arrA); The output will be `[0,1,2,3,4,5]`. -The `slice` function copies all the elements of the array returning the new array. That's why +The `slice` function copies all the elements of the array returning the new array. That\'s why `arrA` and `arrB` reference two completely different arrays. @@ -4648,7 +4648,7 @@ console.log("three");
Answer -_Answer:_ `one`, `three` and `two`. It's because `console.log('two');` will be +_Answer:_ `one`, `three` and `two`. It\'s because `console.log('two');` will be invoked in the next event loop.
@@ -5097,7 +5097,7 @@ const mouse = { **Answer:** -In JavaScript, all object keys are strings (unless it's a Symbol). Even though we might not _type_ them as strings, they are always converted into strings under the hood. +In JavaScript, all object keys are strings (unless it\'s a Symbol). Even though we might not _type_ them as strings, they are always converted into strings under the hood. JavaScript interprets (or unboxes) statements. When we use bracket notation, it sees the first opening bracket `[` and keeps going until it finds the closing bracket `]`. Only then, it will evaluate the statement. @@ -5156,11 +5156,11 @@ console.log(b === c); **Answer:** -`new Number()` is a built-in function constructor. Although it looks like a number, it's not really a number: it has a bunch of extra features and is an object. +`new Number()` is a built-in function constructor. Although it looks like a number, it\'s not really a number: it has a bunch of extra features and is an object. When we use the `==` operator, it only checks whether it has the same _value_. They both have the value of `3`, so it returns `true`. -However, when we use the `===` operator, both value _and_ type should be the same. It's not: `new Number()` is not a number, it's an **object**. Both return `false.` +However, when we use the `===` operator, both value _and_ type should be the same. It\'s not: `new Number()` is not a number, it\'s an **object**. Both return `false.` @@ -5517,7 +5517,7 @@ const sum = eval("10*10+5"); **Answer:** -`eval` evaluates codes that's passed as a string. If it's an expression, like in this case, it evaluates the expression. The expression is `10 * 10 + 5`. This returns the number `105`. +`eval` evaluates codes that\'s passed as a string. If it\'s an expression, like in this case, it evaluates the expression. The expression is `10 * 10 + 5`. This returns the number `105`. @@ -5622,7 +5622,7 @@ If you have two keys with the same name, the key will be replaced. It will still **Answer: A** -The base execution context is the global execution context: it's What is accessible everywhere in your code. +The base execution context is the global execution context: it\'s What is accessible everywhere in your code. @@ -5734,7 +5734,7 @@ Now, `foo` gets invoked, and `"First"` is being logged. -The WebAPI can\'t just add stuff to the stack whenever it's ready. Instead, it pushes the callback function to something called the _queue_. +The WebAPI can\'t just add stuff to the stack whenever it\'s ready. Instead, it pushes the callback function to something called the _queue_. @@ -5742,7 +5742,7 @@ This is where an event loop starts to work. An **event loop** looks at the stack -`bar` gets invoked, `"Second"` gets logged, and it's popped off the stack. +`bar` gets invoked, `"Second"` gets logged, and it\'s popped off the stack. @@ -5827,7 +5827,7 @@ console.log(typeof sayHi()); The `sayHi` function returns the returned value of the immediately invoked function (IIFE). This function returned `0`, which is type `"number"`. -FYI: there are only 7 built-in types: `null`, `undefined`, `boolean`, `number`, `string`, `object`, and `symbol`. `"function"` is not a type, since functions are objects, it's of type `"object"`. +FYI: there are only 7 built-in types: `null`, `undefined`, `boolean`, `number`, `string`, `object`, and `symbol`. `"function"` is not a type, since functions are objects, it\'s of type `"object"`. @@ -5896,7 +5896,7 @@ When you set a value to an element in an array that exceeds the length of the ar `[1, 2, 3, 7 x empty, 11]` -depending on where you run it (it's different for every browser, node, etc.) +depending on where you run it (it\'s different for every browser, node, etc.) @@ -6217,18 +6217,15 @@ getInfo(person, birthYear); console.log(person, birthYear); ``` -- A: `{ name: "Lydia" }, "1997"` -- B: `{ name: "Sarah" }, "1998"` -- C: `{ name: "Lydia" }, "1998"` -- D: `{ name: "Sarah" }, "1997"` +
Answer -**Answer: A** +Arguments are passed by _value_, unless their value is an object, then they're passed by _reference_. `birthYear` is passed by value, since it\'s a string, not an object. When we pass arguments by value, a _copy_ of that value is created (see question 46). -Arguments are passed by _value_, unless their value is an object, then they're passed by _reference_. `birthYear` is passed by value, since it's a string, not an object. When we pass arguments by value, a _copy_ of that value is created (see question 46). +The variable `birthYear` has a reference to the value `"1997"`. The argument `year` also has a reference to the value `"1997"`, but it\'s not the same value as `birthYear` has a reference to. When we update the value of `year` by setting `year` equal to `"1998"`, we are only updating the value of `year`. `birthYear` is still equal to `"1997"`. -The variable `birthYear` has a reference to the value `"1997"`. The argument `year` also has a reference to the value `"1997"`, but it's not the same value as `birthYear` has a reference to. When we update the value of `year` by setting `year` equal to `"1998"`, we are only updating the value of `year`. `birthYear` is still equal to `"1997"`. +The value of `person` is an object. The argument `member` has a (copied) reference to the _same_ object. When we modify a property of the object `member` has a reference to, the value of `person` will also be modified, since they both have a reference to the same object. `person`\'s `name` property is now equal to the value `"Lydia"` -The value of `person` is an object. The argument `member` has a (copied) reference to the _same_ object. When we modify a property of the object `member` has a reference to, the value of `person` will also be modified, since they both have a reference to the same object. `person`'s `name` property is now equal to the value `"Lydia"` +
↥ back to top @@ -6253,17 +6250,14 @@ function sayHi() { sayHi(); ``` -- A: `It worked! Hello world!` -- B: `Oh no an error: undefined` -- C: `SyntaxError: can only throw Error objects` -- D: `Oh no an error: Hello world!` - -**Answer: D** +
Answer With the `throw` statement, we can create custom errors. With this statement, you can throw exceptions. An exception can be a string, a number, a boolean or an object. In this case, our exception is the string `'Hello world'`. With the `catch` statement, we can specify what to do if an exception is thrown in the `try` block. An exception is thrown: the string `'Hello world'`. `e` is now equal to that string, which we log. This results in `'Oh an error: Hello world'`. +
+ @@ -6280,15 +6274,12 @@ const myCar = new Car(); console.log(myCar.make); ``` -- A: `"Lamborghini"` -- B: `"Maserati"` -- C: `ReferenceError` -- D: `TypeError` - -**Answer: B** +
Answer When you return a property, the value of the property is equal to the _returned_ value, not the value set in the constructor function. We return the string `"Maserati"`, so `myCar.make` is equal to `"Maserati"`. +
+ @@ -6304,12 +6295,7 @@ console.log(typeof x); console.log(typeof y); ``` -- A: `"undefined", "number"` -- B: `"number", "number"` -- C: `"object", "number"` -- D: `"number", "undefined"` - -**Answer: A** +
Answer `let x = y = 10;` is actually shorthand for: @@ -6320,10 +6306,12 @@ let x = y; When we set `y` equal to `10`, we actually add a property `y` to the global object (`window` in browser, `global` in Node). In a browser, `window.y` is now equal to `10`. -Then, we declare a variable `x` with the value of `y`, which is `10`. Variables declared with the `let` keyword are _block scoped_, they are only defined within the block they're declared in; the immediately-invoked function (IIFE) in this case. When we use the `typeof` operator, the operand `x` is not defined: we are trying to access `x` outside of the block it's declared in. This means that `x` is not defined. Values who haven\'t been assigned a value or declared are of type `"undefined"`. `console.log(typeof x)` returns `"undefined"`. +Then, we declare a variable `x` with the value of `y`, which is `10`. Variables declared with the `let` keyword are _block scoped_, they are only defined within the block they're declared in; the immediately-invoked function (IIFE) in this case. When we use the `typeof` operator, the operand `x` is not defined: we are trying to access `x` outside of the block it\'s declared in. This means that `x` is not defined. Values who haven\'t been assigned a value or declared are of type `"undefined"`. `console.log(typeof x)` returns `"undefined"`. However, we created a global variable `y` when setting `y` equal to `10`. This value is accessible anywhere in our code. `y` is defined, and holds a value of type `"number"`. `console.log(typeof y)` returns `"number"`. +
+ @@ -6350,17 +6338,14 @@ delete Dog.prototype.bark; pet.bark(); ``` -- A: `"Woof I am Mara"`, `TypeError` -- B: `"Woof I am Mara"`, `"Woof I am Mara"` -- C: `"Woof I am Mara"`, `undefined` -- D: `TypeError`, `TypeError` - -**Answer: A** +
Answer We can delete properties from objects using the `delete` keyword, also on the prototype. By deleting a property on the prototype, it is not available anymore in the prototype chain. In this case, the `bark` function is not available anymore on the prototype after `delete Dog.prototype.bark`, yet we still try to access it. When we try to invoke something that is not a function, a `TypeError` is thrown. In this case `TypeError: pet.bark is not a function`, since `pet.bark` is `undefined`. +
+ @@ -6373,17 +6358,14 @@ const set = new Set([1, 1, 2, 3, 4]); console.log(set); ``` -- A: `[1, 1, 2, 3, 4]` -- B: `[1, 2, 3, 4]` -- C: `{1, 1, 2, 3, 4}` -- D: `{1, 2, 3, 4}` - -**Answer: D** +
Answer The `Set` object is a collection of _unique_ values: a value can only occur once in a set. We passed the iterable `[1, 1, 2, 3, 4]` with a duplicate value `1`. Since we cannot have two of the same values in a set, one of them is removed. This results in `{1, 2, 3, 4}`. +
+ @@ -6405,17 +6387,14 @@ myCounter += 1; console.log(myCounter); ``` -- A: `10` -- B: `11` -- C: `Error` -- D: `NaN` - -**Answer: C** +
Answer An imported module is _read-only_: you cannot modify the imported module. Only the module that exports them can change its value. When we try to increment the value of `myCounter`, it throws an error: `myCounter` is read-only and cannot be modified. +
+ @@ -6430,17 +6409,14 @@ console.log(delete name); console.log(delete age); ``` -- A: `false`, `true` -- B: `"Lydia"`, `21` -- C: `true`, `true` -- D: `undefined`, `undefined` - -**Answer: A** +
Answer The `delete` operator returns a boolean value: `true` on a successful deletion, else it'll return `false`. However, variables declared with the `var`, `const` or `let` keyword cannot be deleted using the `delete` operator. The `name` variable was declared with a `const` keyword, so its deletion is not successful: `false` is returned. When we set `age` equal to `21`, we actually added a property called `age` to the global object. You can successfully delete properties from objects this way, also the global object, so `delete age` returns `true`. +
+ @@ -6454,12 +6430,7 @@ const [y] = numbers; console.log(y); ``` -- A: `[[1, 2, 3, 4, 5]]` -- B: `[1, 2, 3, 4, 5]` -- C: `1` -- D: `[1]` - -**Answer: C** +
Answer We can unpack values from arrays or properties from objects through destructuring. For example: @@ -6479,6 +6450,8 @@ The value of `a` is now `1`, and the value of `b` is now `2`. What we actually d This means that the value of `y` is equal to the first value in the array, which is the number `1`. When we log `y`, `1` is returned. +
+ @@ -6492,14 +6465,11 @@ const admin = { admin: true, ...user }; console.log(admin); ``` -- A: `{ admin: true, user: { name: "Lydia", age: 21 } }` -- B: `{ admin: true, name: "Lydia", age: 21 }` -- C: `{ admin: true, user: ["Lydia", 21] }` -- D: `{ admin: true }` +
Answer -**Answer: B** +It\'s possible to combine objects using the spread operator `...`. It lets you create copies of the key/value pairs of one object, and add them to another object. In this case, we create copies of the `user` object, and add them to the `admin` object. The `admin` object now contains the copied key/value pairs, which results in `{ admin: true, name: "Lydia", age: 21 }`. -It's possible to combine objects using the spread operator `...`. It lets you create copies of the key/value pairs of one object, and add them to another object. In this case, we create copies of the `user` object, and add them to the `admin` object. The `admin` object now contains the copied key/value pairs, which results in `{ admin: true, name: "Lydia", age: 21 }`. +<\details>
↥ back to top @@ -6555,7 +6525,7 @@ The second argument of `JSON.stringify` is the _replacer_. The replacer can eith If the replacer is an _array_, only the property names included in the array will be added to the JSON string. In this case, only the properties with the names `"level"` and `"health"` are included, `"username"` is excluded. `data` is now equal to `"{"level":19, "health":90}"`. -If the replacer is a _function_, this function gets called on every property in the object you're stringifying. The value returned from this function will be the value of the property when it's added to the JSON string. If the value is `undefined`, this property is excluded from the JSON string. +If the replacer is a _function_, this function gets called on every property in the object you're stringifying. The value returned from this function will be the value of the property when it\'s added to the JSON string. If the value is `undefined`, this property is excluded from the JSON string.
↥ back to top @@ -6699,7 +6669,7 @@ class Labrador extends Dog { In a derived class, you cannot access the `this` keyword before calling `super`. If you try to do that, it will throw a ReferenceError: 1 and 4 would throw a reference error. -With the `super` keyword, we call that parent class's constructor with the given arguments. The parent's constructor receives the `name` argument, so we need to pass `name` to `super`. +With the `super` keyword, we call that parent class\'s constructor with the given arguments. The parent\'s constructor receives the `name` argument, so we need to pass `name` to `super`. The `Labrador` class receives two arguments, `name` since it extends `Dog`, and `size` as an extra property on the `Labrador` class. They both need to be passed to the constructor function on `Labrador`, which is done correctly using constructor 2. @@ -6938,7 +6908,7 @@ console.log(shape); **Answer: B** -`Object.freeze` makes it impossible to add, remove, or modify properties of an object (unless the property's value is another object). +`Object.freeze` makes it impossible to add, remove, or modify properties of an object (unless the property\'s value is another object). When we create the variable `shape` and set it equal to the frozen object `box`, `shape` also refers to a frozen object. You can check whether an object is frozen by using `Object.isFrozen`. In this case, `Object.isFrozen(shape)` returns true, since the variable `shape` has a reference to a frozen object. @@ -7025,7 +6995,7 @@ console.log(addFunction(5 * 2)); The `add` function is a _memoized_ function. With memoization, we can cache the results of a function in order to speed up its execution. In this case, we create a `cache` object that stores the previously returned values. -If we call the `addFunction` function again with the same argument, it first checks whether it has already gotten that value in its cache. If that's the case, the caches value will be returned, which saves on execution time. Else, if it's not cached, it will calculate the value and store it afterwards. +If we call the `addFunction` function again with the same argument, it first checks whether it has already gotten that value in its cache. If that\'s the case, the caches value will be returned, which saves on execution time. Else, if it\'s not cached, it will calculate the value and store it afterwards. We call the `addFunction` function three times with the same value: on the first invocation, the value of the function when `num` is equal to `10` isn\'t cached yet. The condition of the if-statement `num in cache` returns `false`, and the else block gets executed: `Calculated! 20` gets logged, and the value of the result gets added to the cache object. `cache` now looks like `{ 10: 20 }`. @@ -7064,7 +7034,7 @@ With a _for-in_ loop, we can iterate over **enumerable** properties. In an array Where the keys are the enumerable properties. `0` `1` `2` `3` get logged. -With a _for-of_ loop, we can iterate over **iterables**. An array is an iterable. When we iterate over the array, the variable "item" is equal to the element it's currently iterating over, `"☕"` ` "💻"` `"🍷"` `"🍫"` get logged. +With a _for-of_ loop, we can iterate over **iterables**. An array is an iterable. When we iterate over the array, the variable "item" is equal to the element it\'s currently iterating over, `"☕"` ` "💻"` `"🍷"` `"🍫"` get logged.
↥ back to top @@ -7212,7 +7182,7 @@ console.log(checkAge(21)); **Answer: C** -Variables with the `const` and `let` keyword are _block-scoped_. A block is anything between curly brackets (`{ }`). In this case, the curly brackets of the if/else statements. You cannot reference a variable outside of the block it's declared in, a ReferenceError gets thrown. +Variables with the `const` and `let` keyword are _block-scoped_. A block is anything between curly brackets (`{ }`). In this case, the curly brackets of the if/else statements. You cannot reference a variable outside of the block it\'s declared in, a ReferenceError gets thrown.
↥ back to top @@ -7260,7 +7230,7 @@ By setting `hasName` equal to `name`, you set `hasName` equal to whatever value `new Boolean(true)` returns an object wrapper, not the boolean value itself. -`name.length` returns the length of the passed argument, not whether it's `true`. +`name.length` returns the length of the passed argument, not whether it\'s `true`.
↥ back to top @@ -7304,9 +7274,9 @@ sum(10); **Answer: B** -You can set a default parameter's value equal to another parameter of the function, as long as they've been defined _before_ the default parameter. We pass the value `10` to the `sum` function. If the `sum` function only receives 1 argument, it means that the value for `num2` is not passed, and the value of `num1` is equal to the passed value `10` in this case. The default value of `num2` is the value of `num1`, which is `10`. `num1 + num2` returns `20`. +You can set a default parameter\'s value equal to another parameter of the function, as long as they've been defined _before_ the default parameter. We pass the value `10` to the `sum` function. If the `sum` function only receives 1 argument, it means that the value for `num2` is not passed, and the value of `num1` is equal to the passed value `10` in this case. The default value of `num2` is the value of `num1`, which is `10`. `num1 + num2` returns `20`. -If you're trying to set a default parameter's value equal to a parameter which is defined _after_ (to the right), the parameter's value hasn\'t been initialized yet, which will throw an error. +If you're trying to set a default parameter\'s value equal to a parameter which is defined _after_ (to the right), the parameter\'s value hasn\'t been initialized yet, which will throw an error.
↥ back to top @@ -7405,7 +7375,7 @@ function giveLydiaPizza() { } const giveLydiaChocolate = () => - "Here's chocolate... now go hit the gym already."; + "Here\'s chocolate... now go hit the gym already."; console.log(giveLydiaPizza.prototype); console.log(giveLydiaChocolate.prototype); @@ -7474,7 +7444,7 @@ getItems(["banana", "apple"], "pear", "orange") **Answer: D** -`...args` is a rest parameter. The rest parameter's value is an array containing all remaining arguments, **and can only be the last parameter**! In this example, the rest parameter was the second parameter. This is not possible, and will throw a syntax error. +`...args` is a rest parameter. The rest parameter\'s value is an array containing all remaining arguments, **and can only be the last parameter**! In this example, the rest parameter was the second parameter. This is not possible, and will throw a syntax error. ```javascript function getItems(fruitList, favoriteFruit, ...args) { @@ -7513,7 +7483,7 @@ console.log(nums(1, 2)); In JavaScript, we don\'t _have_ to write the semicolon (`;`) explicitly, however the JavaScript engine still adds them after statements. This is called **Automatic Semicolon Insertion**. A statement can for example be variables, or keywords like `throw`, `return`, `break`, etc. -Here, we wrote a `return` statement, and another value `a + b` on a _new line_. However, since it's a new line, the engine doesn\'t know that it's actually the value that we wanted to return. Instead, it automatically added a semicolon after `return`. You could see this as: +Here, we wrote a `return` statement, and another value `a + b` on a _new line_. However, since it\'s a new line, the engine doesn\'t know that it\'s actually the value that we wanted to return. Instead, it automatically added a semicolon after `return`. You could see this as: ```javascript return; @@ -7725,9 +7695,9 @@ secondFunction(); **Answer: D** -With a promise, we basically say _I want to execute this function, but I'll put it aside for now while it's running since this might take a while. Only when a certain value is resolved (or rejected), and when the call stack is empty, I want to use this value._ +With a promise, we basically say _I want to execute this function, but I'll put it aside for now while it\'s running since this might take a while. Only when a certain value is resolved (or rejected), and when the call stack is empty, I want to use this value._ -We can get this value with both `.then` and the `await` keyword in an `async` function. Although we can get a promise's value with both `.then` and `await`, they work a bit differently. +We can get this value with both `.then` and the `await` keyword in an `async` function. Although we can get a promise\'s value with both `.then` and `await`, they work a bit differently. In the `firstFunction`, we (sort of) put the myPromise function aside while it was running, but continued running the other code, which is `console.log('second')` in this case. Then, the function resolved with the string `I have resolved`, which then got logged after it saw that the callstack was empty. @@ -7853,7 +7823,7 @@ console.log(colorConfig.colors[1]); In JavaScript, we have two ways to access properties on an object: bracket notation, or dot notation. In this example, we use dot notation (`colorConfig.colors`) instead of bracket notation (`colorConfig["colors"]`). -With dot notation, JavaScript tries to find the property on the object with that exact name. In this example, JavaScript tries to find a property called `colors` on the `colorConfig` object. There is no proprety called `colors`, so this returns `undefined`. Then, we try to access the value of the first element by using `[1]`. We cannot do this on a value that's `undefined`, so it throws a `TypeError`: `Cannot read property '1' of undefined`. +With dot notation, JavaScript tries to find the property on the object with that exact name. In this example, JavaScript tries to find a property called `colors` on the `colorConfig` object. There is no proprety called `colors`, so this returns `undefined`. Then, we try to access the value of the first element by using `[1]`. We cannot do this on a value that\'s `undefined`, so it throws a `TypeError`: `Cannot read property '1' of undefined`. JavaScript interprets (or unboxes) statements. When we use bracket notation, it sees the first opening bracket `[` and keeps going until it finds the closing bracket `]`. Only then, it will evaluate the statement. If we would've used `colorConfig[colors[1]]`, it would have returned the value of the `red` property on the `colorConfig` object. @@ -7926,9 +7896,9 @@ console.log(food); We set the value of the `favoriteFood` property on the `info` object equal to the string with the pizza emoji, `'🍕'`. A string is a primitive data type. In JavaScript, primitive data types act by reference -In JavaScript, primitive data types (everything that's not an object) interact by _value_. In this case, we set the value of the `favoriteFood` property on the `info` object equal to the value of the first element in the `food` array, the string with the pizza emoji in this case (`'🍕'`). A string is a primitive data type, and interact by value (see my [blogpost](https://www.theavocoder.com/complete-javascript/2018/12/21/by-value-vs-by-reference) if you're interested in learning more) +In JavaScript, primitive data types (everything that\'s not an object) interact by _value_. In this case, we set the value of the `favoriteFood` property on the `info` object equal to the value of the first element in the `food` array, the string with the pizza emoji in this case (`'🍕'`). A string is a primitive data type, and interact by value (see my [blogpost](https://www.theavocoder.com/complete-javascript/2018/12/21/by-value-vs-by-reference) if you're interested in learning more) -Then, we change the value of the `favoriteFood` property on the `info` object. The `food` array hasn\'t changed, since the value of `favoriteFood` was merely a _copy_ of the value of the first element in the array, and doesn\'t have a reference to the same spot in memory as the element on `food[0]`. When we log food, it's still the original array, `['🍕', '🍫', '🥑', '🍔']`. +Then, we change the value of the `favoriteFood` property on the `info` object. The `food` array hasn\'t changed, since the value of `favoriteFood` was merely a _copy_ of the value of the first element in the array, and doesn\'t have a reference to the same spot in memory as the element on `food[0]`. When we log food, it\'s still the original array, `['🍕', '🍫', '🥑', '🍔']`.
↥ back to top @@ -7987,7 +7957,7 @@ getName(); **Answer: D** -Each function has its own _execution context_ (or _scope_). The `getName` function first looks within its own context (scope) to see if it contains the variable `name` we're trying to access. In this case, the `getName` function contains its own `name` variable: we declare the variable `name` with the `let` keyword, and with the value of `'Sarah'`. +Each function has its own _execution context_ (or _scope_). The `getName` function first looks within its own context (scope) to see if it contains the variable `name` we're trying to access. In this case, the `getName` function contains its own `name` variable: we declare the variable `name` with the `let` keyword, and with the value of `'sarah'`. Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don\'t get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`. @@ -8092,7 +8062,7 @@ config = null; **Answer: C** -Normally when we set objects equal to `null`, those objects get _garbage collected_ as there is no reference anymore to that object. However, since the callback function within `setInterval` is an arrow function (thus bound to the `config` object), the callback function still holds a reference to the `config` object. As long as there is a reference, the object won\'t get garbage collected. Since it's not garbage collected, the `setInterval` callback function will still get invoked every 1000ms (1s). +Normally when we set objects equal to `null`, those objects get _garbage collected_ as there is no reference anymore to that object. However, since the callback function within `setInterval` is an arrow function (thus bound to the `config` object), the callback function still holds a reference to the `config` object. As long as there is a reference, the object won\'t get garbage collected. Since it\'s not garbage collected, the `setInterval` callback function will still get invoked every 1000ms (1s).
↥ back to top @@ -8161,7 +8131,7 @@ Both the `changeAge` and `changeAgeAndName` functions have a default parameter, First, we invoke the `changeAge` function and pass the `person` object as its argument. This function increases the value of the `age` property by 1. `person` is now `{ name: "Lydia", age: 22 }`. -Then, we invoke the `changeAgeAndName` function, however we don\'t pass a parameter. Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it's a new object, it doesn\'t affect the values of the properties on the `person` object. `person` is still equal to `{ name: "Lydia", age: 22 }`. +Then, we invoke the `changeAgeAndName` function, however we don\'t pass a parameter. Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it\'s a new object, it doesn\'t affect the values of the properties on the `person` object. `person` is still equal to `{ name: "Lydia", age: 22 }`.
↥ back to top From e6cea733c399ea31bb64c632bc3e51bfa93f87d3 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 23 Oct 2022 12:23:18 +0530 Subject: [PATCH 032/117] Update README.md --- README.md | 55 ++++++++++++++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 4f18acc..85c44b5 100644 --- a/README.md +++ b/README.md @@ -2803,7 +2803,7 @@ console.log(strA);
Answer -The output will `'hi there'` because we're dealing with strings here. Strings are +The output will `'hi there'` because we\'re dealing with strings here. Strings are passed by value, that is, copied.
@@ -2823,7 +2823,7 @@ console.log(objA);
Answer -The output will `{prop1: 90}` because we're dealing with objects here. Objects are +The output will `{prop1: 90}` because we\'re dealing with objects here. Objects are passed by reference, that is, `objA` and `objB` point to the same object in memory.
@@ -5072,7 +5072,7 @@ There is no value `radius` on that object, which returns `undefined`. The unary plus tries to convert an operand to a number. `true` is `1`, and `false` is `0`. -The string `'Lydia'` is a truthy value. What we're actually asking, is "is this truthy value falsy?". This returns `false`. +The string `'Lydia'` is a truthy value. What we\'re actually asking, is "is this truthy value falsy?". This returns `false`.
@@ -5103,7 +5103,7 @@ JavaScript interprets (or unboxes) statements. When we use bracket notation, it `mouse[bird.size]`: First it evaluates `bird.size`, which is `"small"`. `mouse["small"]` returns `true` -However, with dot notation, this doesn\'t happen. `mouse` does not have a key called `bird`, which means that `mouse.bird` is `undefined`. Then, we ask for the `size` using dot notation: `mouse.bird.size`. Since `mouse.bird` is `undefined`, we're actually asking `undefined.size`. This isn\'t valid, and will throw an error similar to `Cannot read property "size" of undefined`. +However, with dot notation, this doesn\'t happen. `mouse` does not have a key called `bird`, which means that `mouse.bird` is `undefined`. Then, we ask for the `size` using dot notation: `mouse.bird.size`. Since `mouse.bird` is `undefined`, we\'re actually asking `undefined.size`. This isn\'t valid, and will throw an error similar to `Cannot read property "size" of undefined`. @@ -5559,7 +5559,7 @@ console.log(num); **Answer:** With the `var` keyword, you can declare multiple variables with the same name. The variable will then hold the latest value. -You cannot do this with `let` or `const` since they're block-scoped. +You cannot do this with `let` or `const` since they\'re block-scoped. @@ -6134,7 +6134,7 @@ for (const item in person) {
Answer -With a `for-in` loop, we can iterate through object keys, in this case `name` and `age`. Under the hood, object keys are strings (if they're not a Symbol). On every loop, we set the value of `item` equal to the current key it’s iterating over. First, `item` is equal to `name`, and gets logged. Then, `item` is equal to `age`, which gets logged. +With a `for-in` loop, we can iterate through object keys, in this case `name` and `age`. Under the hood, object keys are strings (if they\'re not a Symbol). On every loop, we set the value of `item` equal to the current key it’s iterating over. First, `item` is equal to `name`, and gets logged. Then, `item` is equal to `age`, which gets logged.
@@ -6219,7 +6219,7 @@ console.log(person, birthYear);
Answer -Arguments are passed by _value_, unless their value is an object, then they're passed by _reference_. `birthYear` is passed by value, since it\'s a string, not an object. When we pass arguments by value, a _copy_ of that value is created (see question 46). +Arguments are passed by _value_, unless their value is an object, then they\'re passed by _reference_. `birthYear` is passed by value, since it\'s a string, not an object. When we pass arguments by value, a _copy_ of that value is created (see question 46). The variable `birthYear` has a reference to the value `"1997"`. The argument `year` also has a reference to the value `"1997"`, but it\'s not the same value as `birthYear` has a reference to. When we update the value of `year` by setting `year` equal to `"1998"`, we are only updating the value of `year`. `birthYear` is still equal to `"1997"`. @@ -6306,7 +6306,7 @@ let x = y; When we set `y` equal to `10`, we actually add a property `y` to the global object (`window` in browser, `global` in Node). In a browser, `window.y` is now equal to `10`. -Then, we declare a variable `x` with the value of `y`, which is `10`. Variables declared with the `let` keyword are _block scoped_, they are only defined within the block they're declared in; the immediately-invoked function (IIFE) in this case. When we use the `typeof` operator, the operand `x` is not defined: we are trying to access `x` outside of the block it\'s declared in. This means that `x` is not defined. Values who haven\'t been assigned a value or declared are of type `"undefined"`. `console.log(typeof x)` returns `"undefined"`. +Then, we declare a variable `x` with the value of `y`, which is `10`. Variables declared with the `let` keyword are _block scoped_, they are only defined within the block they\'re declared in; the immediately-invoked function (IIFE) in this case. When we use the `typeof` operator, the operand `x` is not defined: we are trying to access `x` outside of the block it\'s declared in. This means that `x` is not defined. Values who haven\'t been assigned a value or declared are of type `"undefined"`. `console.log(typeof x)` returns `"undefined"`. However, we created a global variable `y` when setting `y` equal to `10`. This value is accessible anywhere in our code. `y` is defined, and holds a value of type `"number"`. `console.log(typeof y)` returns `"number"`. @@ -6486,16 +6486,13 @@ console.log(person); console.log(Object.keys(person)); ``` -- A: `{ name: "Lydia", age: 21 }`, `["name", "age"]` -- B: `{ name: "Lydia", age: 21 }`, `["name"]` -- C: `{ name: "Lydia"}`, `["name", "age"]` -- D: `{ name: "Lydia"}`, `["age"]` - -**Answer: B** +
Answer With the `defineProperty` method, we can add new properties to an object, or modify existing ones. When we add a property to an object using the `defineProperty` method, they are by default _not enumerable_. The `Object.keys` method returns all _enumerable_ property names from an object, in this case only `"name"`. -Properties added using the `defineProperty` method are immutable by default. You can override this behavior using the `writable`, `configurable` and `enumerable` properties. This way, the `defineProperty` method gives you a lot more control over the properties you're adding to an object. +Properties added using the `defineProperty` method are immutable by default. You can override this behavior using the `writable`, `configurable` and `enumerable` properties. This way, the `defineProperty` method gives you a lot more control over the properties you\'re adding to an object. + +<\details>
↥ back to top @@ -6525,7 +6522,7 @@ The second argument of `JSON.stringify` is the _replacer_. The replacer can eith If the replacer is an _array_, only the property names included in the array will be added to the JSON string. In this case, only the properties with the names `"level"` and `"health"` are included, `"username"` is excluded. `data` is now equal to `"{"level":19, "health":90}"`. -If the replacer is a _function_, this function gets called on every property in the object you're stringifying. The value returned from this function will be the value of the property when it\'s added to the JSON string. If the value is `undefined`, this property is excluded from the JSON string. +If the replacer is a _function_, this function gets called on every property in the object you\'re stringifying. The value returned from this function will be the value of the property when it\'s added to the JSON string. If the value is `undefined`, this property is excluded from the JSON string.
↥ back to top @@ -6774,7 +6771,7 @@ With the `+` operator, you can concatenate strings. In this case, we are concate function* startGame() { const answer = yield "Do you love JavaScript?"; if (answer !== "Yes") { - return "Oh wow... Guess we're gone here"; + return "Oh wow... Guess we\'re gone here"; } return "JavaScript loves you back ❤️"; } @@ -7164,9 +7161,9 @@ When logging the `person` object, the unmodified object gets returned. ```javascript function checkAge(age) { if (age < 18) { - const message = "Sorry, you're too young."; + const message = "Sorry, you\'re too young."; } else { - const message = "Yay! You're old enough!"; + const message = "Yay! You\'re old enough!"; } return message; @@ -7175,8 +7172,8 @@ function checkAge(age) { console.log(checkAge(21)); ``` -- A: `"Sorry, you're too young."` -- B: `"Yay! You're old enough!"` +- A: `"Sorry, you\'re too young."` +- B: `"Yay! You\'re old enough!"` - C: `ReferenceError` - D: `undefined` @@ -7276,7 +7273,7 @@ sum(10); You can set a default parameter\'s value equal to another parameter of the function, as long as they've been defined _before_ the default parameter. We pass the value `10` to the `sum` function. If the `sum` function only receives 1 argument, it means that the value for `num2` is not passed, and the value of `num1` is equal to the passed value `10` in this case. The default value of `num2` is the value of `num1`, which is `10`. `num1 + num2` returns `20`. -If you're trying to set a default parameter\'s value equal to a parameter which is defined _after_ (to the right), the parameter\'s value hasn\'t been initialized yet, which will throw an error. +If you\'re trying to set a default parameter\'s value equal to a parameter which is defined _after_ (to the right), the parameter\'s value hasn\'t been initialized yet, which will throw an error.
↥ back to top @@ -7607,10 +7604,10 @@ console.log(name()); The variable `name` holds the value of a string, which is not a function, thus cannot invoke. -TypeErrors get thrown when a value is not of the expected type. JavaScript expected `name` to be a function since we're trying to invoke it. It was a string however, so a TypeError gets thrown: name is not a function! +TypeErrors get thrown when a value is not of the expected type. JavaScript expected `name` to be a function since we\'re trying to invoke it. It was a string however, so a TypeError gets thrown: name is not a function! SyntaxErrors get thrown when you've written something that isn\'t valid JavaScript, for example when you've written the word `return` as `retrun`. -ReferenceErrors get thrown when JavaScript isn\'t able to find a reference to a value that you're trying to access. +ReferenceErrors get thrown when JavaScript isn\'t able to find a reference to a value that you\'re trying to access.
↥ back to top @@ -7786,7 +7783,7 @@ compareMembers(person); **Answer: B** -Objects are passed by reference. When we check objects for strict equality (`===`), we're comparing their references. +Objects are passed by reference. When we check objects for strict equality (`===`), we\'re comparing their references. We set the default value for `person2` equal to the `person` object, and passed the `person` object as the value for `person1`. @@ -7842,7 +7839,7 @@ console.log("❤️" === "❤️"); **Answer: A** -Under the hood, emojis are unicodes. The unicodes for the heart emoji is `"U+2764 U+FE0F"`. These are always the same for the same emojis, so we're comparing two equal strings to each other, which returns true. +Under the hood, emojis are unicodes. The unicodes for the heart emoji is `"U+2764 U+FE0F"`. These are always the same for the same emojis, so we\'re comparing two equal strings to each other, which returns true.
↥ back to top @@ -7896,7 +7893,7 @@ console.log(food); We set the value of the `favoriteFood` property on the `info` object equal to the string with the pizza emoji, `'🍕'`. A string is a primitive data type. In JavaScript, primitive data types act by reference -In JavaScript, primitive data types (everything that\'s not an object) interact by _value_. In this case, we set the value of the `favoriteFood` property on the `info` object equal to the value of the first element in the `food` array, the string with the pizza emoji in this case (`'🍕'`). A string is a primitive data type, and interact by value (see my [blogpost](https://www.theavocoder.com/complete-javascript/2018/12/21/by-value-vs-by-reference) if you're interested in learning more) +In JavaScript, primitive data types (everything that\'s not an object) interact by _value_. In this case, we set the value of the `favoriteFood` property on the `info` object equal to the value of the first element in the `food` array, the string with the pizza emoji in this case (`'🍕'`). A string is a primitive data type, and interact by value (see my [blogpost](https://www.theavocoder.com/complete-javascript/2018/12/21/by-value-vs-by-reference) if you\'re interested in learning more) Then, we change the value of the `favoriteFood` property on the `info` object. The `food` array hasn\'t changed, since the value of `favoriteFood` was merely a _copy_ of the value of the first element in the array, and doesn\'t have a reference to the same spot in memory as the element on `food[0]`. When we log food, it\'s still the original array, `['🍕', '🍫', '🥑', '🍔']`. @@ -7957,7 +7954,7 @@ getName(); **Answer: D** -Each function has its own _execution context_ (or _scope_). The `getName` function first looks within its own context (scope) to see if it contains the variable `name` we're trying to access. In this case, the `getName` function contains its own `name` variable: we declare the variable `name` with the `let` keyword, and with the value of `'sarah'`. +Each function has its own _execution context_ (or _scope_). The `getName` function first looks within its own context (scope) to see if it contains the variable `name` we\'re trying to access. In this case, the `getName` function contains its own `name` variable: we declare the variable `name` with the `let` keyword, and with the value of `'sarah'`. Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don\'t get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`. @@ -8094,7 +8091,7 @@ myMap.get(() => "greeting"); When adding a key/value pair using the `set` method, the key will be the value of the first argument passed to the `set` function, and the value will be the second argument passed to the `set` function. The key is the _function_ `() => 'greeting'` in this case, and the value `'Hello world'`. `myMap` is now `{ () => 'greeting' => 'Hello world!' }`. 1 is wrong, since the key is not `'greeting'` but `() => 'greeting'`. -3 is wrong, since we're creating a new function by passing it as a parameter to the `get` method. Object interact by _reference_. Functions are objects, which is why two functions are never strictly equal, even if they are identical: they have a reference to a different spot in memory. +3 is wrong, since we\'re creating a new function by passing it as a parameter to the `get` method. Object interact by _reference_. Functions are objects, which is why two functions are never strictly equal, even if they are identical: they have a reference to a different spot in memory.
↥ back to top From da28ca6dae73f6e9931b77d571311ef64403fcde Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 23 Oct 2022 12:53:42 +0530 Subject: [PATCH 033/117] Update README.md --- README.md | 676 +++++++++++------------------------------------------- 1 file changed, 140 insertions(+), 536 deletions(-) diff --git a/README.md b/README.md index 85c44b5..9bda1da 100644 --- a/README.md +++ b/README.md @@ -5537,7 +5537,7 @@ sessionStorage.setItem("cool_secret", 123); The data stored in `sessionStorage` is removed after closing the _tab_. -If you used `localStorage`, the data would've been there forever, unless for example `localStorage.clear()` is invoked. +If you used `localStorage`, the data would\'ve been there forever, unless for example `localStorage.clear()` is invoked.
@@ -6511,12 +6511,7 @@ const data = JSON.stringify(settings, ["level", "health"]); console.log(data); ``` -- A: `"{"level":19, "health":90}"` -- B: `"{"username": "lydiahallie"}"` -- C: `"["level", "health"]"` -- D: `"{"username": "lydiahallie", "level":19, "health":90}"` - -**Answer: A** +
Answer The second argument of `JSON.stringify` is the _replacer_. The replacer can either be a function or an array, and lets you control what and how the values should be stringified. @@ -6524,6 +6519,8 @@ If the replacer is an _array_, only the property names included in the array wil If the replacer is a _function_, this function gets called on every property in the object you\'re stringifying. The value returned from this function will be the value of the property when it\'s added to the JSON string. If the value is `undefined`, this property is excluded from the JSON string. +
+ @@ -6543,17 +6540,14 @@ console.log(num1); console.log(num2); ``` -- A: `10`, `10` -- B: `10`, `11` -- C: `11`, `11` -- D: `11`, `12` - -**Answer: A** +
Answer The unary operator `++` _first returns_ the value of the operand, _then increments_ the value of the operand. The value of `num1` is `10`, since the `increaseNumber` function first returns the value of `num`, which is `10`, and only increments the value of `num` afterwards. `num2` is `10`, since we passed `num1` to the `increasePassedNumber`. `number` is equal to `10`(the value of `num1`. Again, the unary operator `++` _first returns_ the value of the operand, _then increments_ the value of the operand. The value of `number` is `10`, so `num2` is equal to `10`. +
+ @@ -6573,12 +6567,7 @@ multiply(value); multiply(value); ``` -- A: `20`, `40`, `80`, `160` -- B: `20`, `40`, `20`, `40` -- C: `20`, `20`, `20`, `40` -- D: `NaN`, `NaN`, `20`, `40` - -**Answer: C** +
Answer In ES6, we can initialize parameters with a default value. The value of the parameter will be the default value, if no other value has been passed to the function, or if the value of the parameter is `"undefined"`. In this case, we spread the properties of the `value` object into a new object, so `x` has the default value of `{ number: 10 }`. @@ -6588,6 +6577,8 @@ The third time we invoke multiply, we do pass an argument: the object called `va The fourth time, we pass the `value` object again. `x.number` was previously modified to `20`, so `x.number *= 2` logs `40`. +
+ @@ -6598,12 +6589,7 @@ The fourth time, we pass the `value` object again. `x.number` was previously mod [1, 2, 3, 4].reduce((x, y) => console.log(x, y)); ``` -- A: `1` `2` and `3` `3` and `6` `4` -- B: `1` `2` and `2` `3` and `3` `4` -- C: `1` `undefined` and `2` `undefined` and `3` `undefined` and `4` `undefined` -- D: `1` `2` and `undefined` `3` and `undefined` `4` - -**Answer: D** +
Answer The first argument that the `reduce` method receives is the _accumulator_, `x` in this case. The second argument is the _current value_, `y`. With the reduce method, we execute a callback function on every element in the array, which could ultimately result in one single value. @@ -6617,9 +6603,7 @@ If you don\'t return a value from a function, it returns `undefined`. On the nex On the fourth call, we again don\'t return from the callback function. The accumulator is again `undefined`, and the current value is `4`. `undefined` and `4` get logged. -

-
---- +
↥ back to top @@ -6657,12 +6641,7 @@ class Labrador extends Dog { } ``` -- A: 1 -- B: 2 -- C: 3 -- D: 4 - -**Answer: B** +
Answer In a derived class, you cannot access the `this` keyword before calling `super`. If you try to do that, it will throw a ReferenceError: 1 and 4 would throw a reference error. @@ -6670,6 +6649,8 @@ With the `super` keyword, we call that parent class\'s constructor with the give The `Labrador` class receives two arguments, `name` since it extends `Dog`, and `size` as an extra property on the `Labrador` class. They both need to be passed to the constructor function on `Labrador`, which is done correctly using constructor 2. +
+ @@ -6687,17 +6668,14 @@ console.log("running sum.js"); export const sum = (a, b) => a + b; ``` -- A: `running index.js`, `running sum.js`, `3` -- B: `running sum.js`, `running index.js`, `3` -- C: `running sum.js`, `3`, `running index.js` -- D: `running index.js`, `undefined`, `running sum.js` - -**Answer: B** +
Answer With the `import` keyword, all imported modules are _pre-parsed_. This means that the imported modules get run _first_, the code in the file which imports the module gets executed _after_. This is a difference between `require()` in CommonJS and `import`! With `require()`, you can load dependencies on demand while the code is being run. If we would have used `require` instead of `import`, `running index.js`, `running sum.js`, `3` would have been logged to the console. +
+ @@ -6710,15 +6688,12 @@ console.log(Boolean(false) === Boolean(false)); console.log(Symbol("foo") === Symbol("foo")); ``` -- A: `true`, `true`, `false` -- B: `false`, `true`, `false` -- C: `true`, `false`, `true` -- D: `true`, `true`, `true` - -**Answer: A** +
Answer Every Symbol is entirely unique. The purpose of the argument passed to the Symbol is to give the Symbol a description. The value of the Symbol is not dependent on the passed argument. As we test equality, we are creating two entirely new symbols: the first `Symbol('foo')`, and the second `Symbol('foo')`. These two values are unique and not equal to each other, `Symbol('foo') === Symbol('foo')` returns `false`. +
+ @@ -6731,68 +6706,13 @@ console.log(name.padStart(13)); console.log(name.padStart(2)); ``` -- A: `"Lydia Hallie"`, `"Lydia Hallie"` -- B: `" Lydia Hallie"`, `" Lydia Hallie"` (`"[13x whitespace]Lydia Hallie"`, `"[2x whitespace]Lydia Hallie"`) -- C: `" Lydia Hallie"`, `"Lydia Hallie"` (`"[1x whitespace]Lydia Hallie"`, `"Lydia Hallie"`) -- D: `"Lydia Hallie"`, `"Lyd"`, - -**Answer: C** +
Answer With the `padStart` method, we can add padding to the beginning of a string. The value passed to this method is the _total_ length of the string together with the padding. The string `"Lydia Hallie"` has a length of `12`. `name.padStart(13)` inserts 1 space at the start of the string, because 12 + 1 is 13. If the argument passed to the `padStart` method is smaller than the length of the array, no padding will be added. - - -## Q. What is the output? - -```javascript -console.log("🥑" + "💻"); -``` - -- A: `"🥑💻"` -- B: `257548` -- C: A string containing their code points -- D: Error - -**Answer: A** - -With the `+` operator, you can concatenate strings. In this case, we are concatenating the string `"🥑"` with the string `"💻"`, resulting in `"🥑💻"`. - - - -## Q. How can we log the values that are commented out after the console.log statement? - -```javascript -function* startGame() { - const answer = yield "Do you love JavaScript?"; - if (answer !== "Yes") { - return "Oh wow... Guess we\'re gone here"; - } - return "JavaScript loves you back ❤️"; -} - -const game = startGame(); -console.log(/* 1 */); // Do you love JavaScript? -console.log(/* 2 */); // JavaScript loves you back ❤️ -``` - -- A: `game.next("Yes").value` and `game.next().value` -- B: `game.next.value("Yes")` and `game.next.value()` -- C: `game.next().value` and `game.next("Yes").value` -- D: `game.next.value()` and `game.next.value("Yes")` - -**Answer: C** - -A generator function "pauses" its execution when it sees the `yield` keyword. First, we have to let the function yield the string "Do you love JavaScript?", which can be done by calling `game.next().value`. - -Every line is executed, until it finds the first `yield` keyword. There is a `yield` keyword on the first line within the function: the execution stops with the first yield! _This means that the variable `answer` is not defined yet!_ - -When we call `game.next("Yes").value`, the previous `yield` is replaced with the value of the parameters passed to the `next()` function, `"Yes"` in this case. The value of the variable `answer` is now equal to `"Yes"`. The condition of the if-statement returns `false`, and `JavaScript loves you back ❤️` gets logged. +
↥ back to top @@ -6804,12 +6724,7 @@ When we call `game.next("Yes").value`, the previous `yield` is replaced with the console.log(String.raw`Hello\nworld`); ``` -- A: `Hello world!` -- B: `Hello`
     `world` -- C: `Hello\nworld` -- D: `Hello\n`
     `world` - -**Answer: C** +
Answer `String.raw` returns a string where the escapes (`\n`, `\v`, `\t` etc.) are ignored! Backslashes can be an issue since you could end up with something like: @@ -6825,6 +6740,8 @@ With `String.raw`, it would simply ignore the escape and print: In this case, the string is `Hello\nworld`, which gets logged. +
+ @@ -6840,12 +6757,7 @@ const data = getData(); console.log(data); ``` -- A: `"I made it!"` -- B: `Promise {: "I made it!"}` -- C: `Promise {}` -- D: `undefined` - -**Answer: C** +
Answer An async function always returns a promise. The `await` still has to wait for the promise to resolve: a pending promise gets returned when we call `getData()` in order to set `data` equal to it. @@ -6853,7 +6765,9 @@ If we wanted to get access to the resolved value `"I made it"`, we could have us `data.then(res => console.log(res))` -This would've logged `"I made it!"` +This would\'ve logged `"I made it!"` + +
↥ back to top @@ -6870,17 +6784,14 @@ const result = addToList("apple", ["banana"]); console.log(result); ``` -- A: `['apple', 'banana']` -- B: `2` -- C: `true` -- D: `undefined` - -**Answer: B** +
Answer The `.push()` method returns the _length_ of the new array! Previously, the array contained one element (the string `"banana"`) and had a length of `1`. After adding the string `"apple"` to the array, the array contains two elements, and has a length of `2`. This gets returned from the `addToList` function. The `push` method modifies the original array. If you wanted to return the _array_ from the function rather than the _length of the array_, you should have returned `list` after pushing `item` to it. +
+ @@ -6898,12 +6809,7 @@ shape.x = 100; console.log(shape); ``` -- A: `{ x: 100, y: 20 }` -- B: `{ x: 10, y: 20 }` -- C: `{ x: 100 }` -- D: `ReferenceError` - -**Answer: B** +
Answer `Object.freeze` makes it impossible to add, remove, or modify properties of an object (unless the property\'s value is another object). @@ -6911,6 +6817,8 @@ When we create the variable `shape` and set it equal to the frozen object `box`, Since `shape` is frozen, and since the value of `x` is not an object, we cannot modify the property `x`. `x` is still equal to `10`, and `{ x: 10, y: 20 }` gets logged. +
+ @@ -6923,12 +6831,7 @@ const { name: myName } = { name: "Lydia" }; console.log(name); ``` -- A: `"Lydia"` -- B: `"myName"` -- C: `undefined` -- D: `ReferenceError` - -**Answer: D** +
Answer When we unpack the property `name` from the object on the right-hand side, we assign its value `"Lydia"` to a variable with the name `myName`. @@ -6936,26 +6839,7 @@ With `{ name: myName }`, we tell JavaScript that we want to create a new variabl Since we try to log `name`, a variable that is not defined, a ReferenceError gets thrown. - - -## Q. Is this a pure function? - -```javascript -function sum(a, b) { - return a + b; -} -``` - -- A: Yes -- B: No - -**Answer: A** - -A pure function is a function that _always_ returns the same result, if the same arguments are passed. - -The `sum` function always returns the same result. If we pass `1` and `2`, it will _always_ return `3` without side effects. If we pass `5` and `10`, it will _always_ return `15`, and so on. This is the definition of a pure function. +
↥ back to top @@ -6983,12 +6867,7 @@ console.log(addFunction(10)); console.log(addFunction(5 * 2)); ``` -- A: `Calculated! 20` `Calculated! 20` `Calculated! 20` -- B: `Calculated! 20` `From cache! 20` `Calculated! 20` -- C: `Calculated! 20` `From cache! 20` `From cache! 20` -- D: `Calculated! 20` `From cache! 20` `Error` - -**Answer: C** +
Answer The `add` function is a _memoized_ function. With memoization, we can cache the results of a function in order to speed up its execution. In this case, we create a `cache` object that stores the previously returned values. @@ -7000,38 +6879,7 @@ The second time, the `cache` object contains the value that gets returned for `1 The third time, we pass `5 * 2` to the function which gets evaluated to `10`. The `cache` object contains the value that gets returned for `10`. The condition of the if-statement `num in cache` returns `true`, and `'From cache! 20'` gets logged. - - -## Q. What is the output? - -```javascript -const myLifeSummedUp = ["☕", "💻", "🍷", "🍫"]; - -for (let item in myLifeSummedUp) { - console.log(item); -} - -for (let item of myLifeSummedUp) { - console.log(item); -} -``` - -- A: `0` `1` `2` `3` and `"☕"` ` "💻"` `"🍷"` `"🍫"` -- B: `"☕"` ` "💻"` `"🍷"` `"🍫"` and `"☕"` ` "💻"` `"🍷"` `"🍫"` -- C: `"☕"` ` "💻"` `"🍷"` `"🍫"` and `0` `1` `2` `3` -- D: `0` `1` `2` `3` and `{0: "☕", 1: "💻", 2: "🍷", 3: "🍫"}` - -**Answer: A** - -With a _for-in_ loop, we can iterate over **enumerable** properties. In an array, the enumerable properties are the "keys" of array elements, which are actually their indexes. You could see an array as: - -`{0: "☕", 1: "💻", 2: "🍷", 3: "🍫"}` - -Where the keys are the enumerable properties. `0` `1` `2` `3` get logged. - -With a _for-of_ loop, we can iterate over **iterables**. An array is an iterable. When we iterate over the array, the variable "item" is equal to the element it\'s currently iterating over, `"☕"` ` "💻"` `"🍷"` `"🍫"` get logged. +
↥ back to top @@ -7044,17 +6892,14 @@ const list = [1 + 2, 1 * 2, 1 / 2]; console.log(list); ``` -- A: `["1 + 2", "1 * 2", "1 / 2"]` -- B: `["12", 2, 0.5]` -- C: `[3, 2, 0.5]` -- D: `[1, 1, 1]` - -**Answer: C** +
Answer Array elements can hold any value. Numbers, strings, objects, other arrays, null, boolean values, undefined, and other expressions such as dates, functions, and calculations. The element will be equal to the returned value. `1 + 2` returns `3`, `1 * 2` returns `2`, and `1 / 2` returns `0.5`. +
+ @@ -7069,12 +6914,7 @@ function sayHi(name) { console.log(sayHi()); ``` -- A: `Hi there, ` -- B: `Hi there, undefined` -- C: `Hi there, null` -- D: `ReferenceError` - -**Answer: B** +
Answer By default, arguments have the value of `undefined`, unless a value has been passed to the function. In this case, we didn\'t pass a value for the `name` argument. `name` is equal to `undefined` which gets logged. @@ -7084,40 +6924,7 @@ In ES6, we can overwrite this default `undefined` value with default parameters. In this case, if we didn\'t pass a value or if we passed `undefined`, `name` would always be equal to the string `Lydia` - - -## Q. What is the output? - -```javascript -var status = "😎"; - -setTimeout(() => { - const status = "😍"; - - const data = { - status: "🥑", - getStatus() { - return this.status; - }, - }; - - console.log(data.getStatus()); - console.log(data.getStatus.call(this)); -}, 0); -``` - -- A: `"🥑"` and `"😍"` -- B: `"🥑"` and `"😎"` -- C: `"😍"` and `"😎"` -- D: `"😎"` and `"😎"` - -**Answer: B** - -The value of the `this` keyword is dependent on where you use it. In a **method**, like the `getStatus` method, the `this` keyword refers to _the object that the method belongs to_. The method belongs to the `data` object, so `this` refers to the `data` object. When we log `this.status`, the `status` property on the `data` object gets logged, which is `"🥑"`. - -With the `call` method, we can change the object to which the `this` keyword refers. In **functions**, the `this` keyword refers to the _the object that the function belongs to_. We declared the `setTimeout` function on the _global object_, so within the `setTimeout` function, the `this` keyword refers to the _global object_. On the global object, there is a variable called _status_ with the value of `"😎"`. When logging `this.status`, `"😎"` gets logged. +
↥ back to top @@ -7137,12 +6944,7 @@ city = "Amsterdam"; console.log(person); ``` -- A: `{ name: "Lydia", age: 21 }` -- B: `{ name: "Lydia", age: 21, city: "Amsterdam" }` -- C: `{ name: "Lydia", age: 21, city: undefined }` -- D: `"Amsterdam"` - -**Answer: A** +
Answer We set the variable `city` equal to the value of the property called `city` on the `person` object. There is no property on this object called `city`, so the variable `city` has the value of `undefined`. @@ -7152,6 +6954,8 @@ Then, we set `city` equal to the string `"Amsterdam"`. This doesn\'t change the When logging the `person` object, the unmodified object gets returned. +
+ @@ -7172,15 +6976,12 @@ function checkAge(age) { console.log(checkAge(21)); ``` -- A: `"Sorry, you\'re too young."` -- B: `"Yay! You\'re old enough!"` -- C: `ReferenceError` -- D: `undefined` - -**Answer: C** +
Answer Variables with the `const` and `let` keyword are _block-scoped_. A block is anything between curly brackets (`{ }`). In this case, the curly brackets of the if/else statements. You cannot reference a variable outside of the block it\'s declared in, a ReferenceError gets thrown. +
+ @@ -7193,15 +6994,12 @@ fetch("https://www.website.com/api/user/1") .then((res) => console.log(res)); ``` -- A: The result of the `fetch` method. -- B: The result of the second invocation of the `fetch` method. -- C: The result of the callback in the previous `.then()`. -- D: It would always be undefined. - -**Answer: C** +
Answer The value of `res` in the second `.then` is equal to the returned value of the previous `.then`. You can keep chaining `.then`s like this, where the value is passed to the next handler. +
+ @@ -7214,12 +7012,7 @@ function getName(name) { } ``` -- A: `!!name` -- B: `name` -- C: `new Boolean(name)` -- D: `name.length` - -**Answer: A** +
Answer With `!!name`, we determine whether the value of `name` is truthy or falsy. If name is truthy, which we want to test for, `!name` returns `false`. `!false` (which is what `!!name` practically is) returns `true`. @@ -7229,6 +7022,8 @@ By setting `hasName` equal to `name`, you set `hasName` equal to whatever value `name.length` returns the length of the passed argument, not whether it\'s `true`. +
+ @@ -7239,17 +7034,14 @@ By setting `hasName` equal to `name`, you set `hasName` equal to whatever value console.log("I want pizza"[0]); ``` -- A: `"""` -- B: `"I"` -- C: `SyntaxError` -- D: `undefined` - -**Answer: B** +
Answer In order to get an character on a specific index in a string, you can use bracket notation. The first character in the string has index 0, and so on. In this case we want to get the element which index is 0, the character `"I'`, which gets logged. Note that this method is not supported in IE7 and below. In that case, use `.charAt()` +
+ @@ -7264,17 +7056,14 @@ function sum(num1, num2 = num1) { sum(10); ``` -- A: `NaN` -- B: `20` -- C: `ReferenceError` -- D: `undefined` - -**Answer: B** +
Answer -You can set a default parameter\'s value equal to another parameter of the function, as long as they've been defined _before_ the default parameter. We pass the value `10` to the `sum` function. If the `sum` function only receives 1 argument, it means that the value for `num2` is not passed, and the value of `num1` is equal to the passed value `10` in this case. The default value of `num2` is the value of `num1`, which is `10`. `num1 + num2` returns `20`. +You can set a default parameter\'s value equal to another parameter of the function, as long as they\'ve been defined _before_ the default parameter. We pass the value `10` to the `sum` function. If the `sum` function only receives 1 argument, it means that the value for `num2` is not passed, and the value of `num1` is equal to the passed value `10` in this case. The default value of `num2` is the value of `num1`, which is `10`. `num1 + num2` returns `20`. If you\'re trying to set a default parameter\'s value equal to a parameter which is defined _after_ (to the right), the parameter\'s value hasn\'t been initialized yet, which will throw an error. +
+ @@ -7292,17 +7081,14 @@ import * as data from "./module"; console.log(data); ``` -- A: `{ default: function default(), name: "Lydia" }` -- B: `{ default: function default() }` -- C: `{ default: "Hello world", name: "Lydia" }` -- D: Global object of `module.js` - -**Answer: A** +
Answer With the `import * as name` syntax, we import _all exports_ from the `module.js` file into the `index.js` file as a new object called `data` is created. In the `module.js` file, there are two exports: the default export, and a named export. The default export is a function which returns the string `"Hello World"`, and the named export is a variable called `name` which has the value of the string `"Lydia"`. The `data` object has a `default` property for the default export, other properties have the names of the named exports and their corresponding values. +
+ @@ -7320,12 +7106,7 @@ const member = new Person("John"); console.log(typeof member); ``` -- A: `"class"` -- B: `"function"` -- C: `"object"` -- D: `"string"` - -**Answer: C** +
Answer Classes are syntactical sugar for function constructors. The equivalent of the `Person` class as a function constructor would be: @@ -7337,6 +7118,8 @@ function Person() { Calling a function constructor with `new` results in the creation of an instance of `Person`, `typeof` keyword returns `"object"` for an instance. `typeof member` returns `"object"`. +
+ @@ -7349,17 +7132,14 @@ let newList = [1, 2, 3].push(4); console.log(newList.push(5)); ``` -- A: `[1, 2, 3, 4, 5]` -- B: `[1, 2, 3, 5]` -- C: `[1, 2, 3, 4]` -- D: `Error` - -**Answer: D** +
Answer The `.push` method returns the _new length_ of the array, not the array itself! By setting `newList` equal to `[1, 2, 3].push(4)`, we set `newList` equal to the new length of the array: `4`. Then, we try to use the `.push` method on `newList`. Since `newList` is the numerical value `4`, we cannot use the `.push` method: a TypeError is thrown. +
+ @@ -7378,15 +7158,12 @@ console.log(giveLydiaPizza.prototype); console.log(giveLydiaChocolate.prototype); ``` -- A: `{ constructor: ...}` `{ constructor: ...}` -- B: `{}` `{ constructor: ...}` -- C: `{ constructor: ...}` `{}` -- D: `{ constructor: ...}` `undefined` - -**Answer: D** +
Answer Regular functions, such as the `giveLydiaPizza` function, have a `prototype` property, which is an object (prototype object) with a `constructor` property. Arrow functions however, such as the `giveLydiaChocolate` function, do not have this `prototype` property. `undefined` gets returned when trying to access the `prototype` property using `giveLydiaChocolate.prototype`. +
+ @@ -7404,12 +7181,7 @@ for (const [x, y] of Object.entries(person)) { } ``` -- A: `name` `Lydia` and `age` `21` -- B: `["name", "Lydia"]` and `["age", 21]` -- C: `["name", "age"]` and `undefined` -- D: `Error` - -**Answer: A** +
Answer `Object.entries(person)` returns an array of nested arrays, containing the keys and objects: @@ -7420,6 +7192,8 @@ Using the `for-of` loop, we can iterate over each element in the array, the suba The first subarray is `[ "name", "Lydia" ]`, with `x` equal to `"name"`, and `y` equal to `"Lydia"`, which get logged. The second subarray is `[ "age", 21 ]`, with `x` equal to `"age"`, and `y` equal to `21`, which get logged. +
+ @@ -7434,12 +7208,7 @@ function getItems(fruitList, ...args, favoriteFruit) { getItems(["banana", "apple"], "pear", "orange") ``` -- A: `["banana", "apple", "pear", "orange"]` -- B: `[["banana", "apple"], "pear", "orange"]` -- C: `["banana", "apple", ["pear"], "orange"]` -- D: `SyntaxError` - -**Answer: D** +
Answer `...args` is a rest parameter. The rest parameter\'s value is an array containing all remaining arguments, **and can only be the last parameter**! In this example, the rest parameter was the second parameter. This is not possible, and will throw a syntax error. @@ -7453,6 +7222,8 @@ getItems(["banana", "apple"], "pear", "orange"); The above example works. This returns the array `[ 'banana', 'apple', 'orange', 'pear' ]` +
+ @@ -7471,12 +7242,7 @@ console.log(nums(4, 2)); console.log(nums(1, 2)); ``` -- A: `a is bigger`, `6` and `b is bigger`, `3` -- B: `a is bigger`, `undefined` and `b is bigger`, `undefined` -- C: `undefined` and `undefined` -- D: `SyntaxError` - -**Answer: B** +
Answer In JavaScript, we don\'t _have_ to write the semicolon (`;`) explicitly, however the JavaScript engine still adds them after statements. This is called **Automatic Semicolon Insertion**. A statement can for example be variables, or keywords like `throw`, `return`, `break`, etc. @@ -7489,6 +7255,8 @@ a + b; This means that `a + b` is never reached, since a function stops running after the `return` keyword. If no value gets returned, like here, the function returns `undefined`. Note that there is no automatic insertion after `if/else` statements! +
+ @@ -7512,15 +7280,12 @@ const member = new Person(); console.log(member.name); ``` -- A: `"Lydia"` -- B: `"Sarah"` -- C: `Error: cannot redeclare Person` -- D: `SyntaxError` - -**Answer: B** +
Answer We can set classes equal to other classes/function constructors. In this case, we set `Person` equal to `AnotherPerson`. The name on this constructor is `Sarah`, so the name property on the new `Person` instance `member` is `"Sarah"`. +
+ @@ -7536,17 +7301,14 @@ console.log(info); console.log(Object.keys(info)); ``` -- A: `{Symbol('a'): 'b'}` and `["{Symbol('a')"]` -- B: `{}` and `[]` -- C: `{ a: "b" }` and `["a"]` -- D: `{Symbol('a'): 'b'}` and `[]` - -**Answer: D** +
Answer A Symbol is not _enumerable_. The Object.keys method returns all _enumerable_ key properties on an object. The Symbol won\'t be visible, and an empty array is returned. When logging the entire object, all properties will be visible, even non-enumerable ones. This is one of the many qualities of a symbol: besides representing an entirely unique value (which prevents accidental name collision on objects, for example when working with 2 libraries that want to add properties to the same object), you can also "hide" properties on objects this way (although not entirely. You can still access symbols using the `Object.getOwnPropertySymbols()` method). +
+ @@ -7564,12 +7326,7 @@ console.log(getList(list)) console.log(getUser(user)) ``` -- A: `[1, [2, 3, 4]]` and `undefined` -- B: `[1, [2, 3, 4]]` and `{ name: "Lydia", age: 21 }` -- C: `[1, 2, 3, 4]` and `{ name: "Lydia", age: 21 }` -- D: `Error` and `{ name: "Lydia", age: 21 }` - -**Answer: A** +
Answer The `getList` function receives an array as its argument. Between the parentheses of the `getList` function, we destructure this array right away. You could see this as: @@ -7583,6 +7340,8 @@ The `getUser` function receives an object. With arrow functions, we don\'t _have Since no value gets returned in this case, the function returns `undefined`. +
+ @@ -7595,20 +7354,17 @@ const name = "Lydia"; console.log(name()); ``` -- A: `SyntaxError` -- B: `ReferenceError` -- C: `TypeError` -- D: `undefined` - -**Answer: C** +
Answer The variable `name` holds the value of a string, which is not a function, thus cannot invoke. TypeErrors get thrown when a value is not of the expected type. JavaScript expected `name` to be a function since we\'re trying to invoke it. It was a string however, so a TypeError gets thrown: name is not a function! -SyntaxErrors get thrown when you've written something that isn\'t valid JavaScript, for example when you've written the word `return` as `retrun`. +SyntaxErrors get thrown when you\'ve written something that isn\'t valid JavaScript, for example when you\'ve written the word `return` as `retrun`. ReferenceErrors get thrown when JavaScript isn\'t able to find a reference to a value that you\'re trying to access. +
+ @@ -7616,23 +7372,18 @@ ReferenceErrors get thrown when JavaScript isn\'t able to find a reference to a ## Q. What is the value of output? ```javascript -// 🎉✨ This is my 100th question! ✨🎉 - const output = `${[] && "Im"}possible! You should${"" && `n't`} see a therapist after so much JavaScript lol`; ``` -- A: `possible! You should see a therapist after so much JavaScript lol` -- B: `Impossible! You should see a therapist after so much JavaScript lol` -- C: `possible! You shouldn\'t see a therapist after so much JavaScript lol` -- D: `Impossible! You shouldn\'t see a therapist after so much JavaScript lol` - -**Answer: B** +
Answer `[]` is a truthy value. With the `&&` operator, the right-hand value will be returned if the left-hand value is a truthy value. In this case, the left-hand value `[]` is a truthy value, so `"Im'` gets returned. `""` is a falsy value. If the left-hand value is falsy, nothing gets returned. `n\'t` doesn\'t get returned. +
+ @@ -7647,12 +7398,7 @@ const three = [] || 0 || true; console.log(one, two, three); ``` -- A: `false` `null` `[]` -- B: `null` `""` `true` -- C: `{}` `""` `[]` -- D: `null` `null` `true` - -**Answer: C** +
Answer With the `||` operator, we can return the first truthy operand. If all values are falsy, the last operand gets returned. @@ -7662,6 +7408,8 @@ With the `||` operator, we can return the first truthy operand. If all values ar `([] || 0 || "")`: the empty array`[]` is a truthy value. This is the first truthy value, which gets returned. `three` is equal to `[]`. +
+ @@ -7685,12 +7433,7 @@ firstFunction(); secondFunction(); ``` -- A: `I have resolved!`, `second` and `I have resolved!`, `second` -- B: `second`, `I have resolved!` and `second`, `I have resolved!` -- C: `I have resolved!`, `second` and `second`, `I have resolved!` -- D: `second`, `I have resolved!` and `I have resolved!`, `second` - -**Answer: D** +
Answer With a promise, we basically say _I want to execute this function, but I'll put it aside for now while it\'s running since this might take a while. Only when a certain value is resolved (or rejected), and when the call stack is empty, I want to use this value._ @@ -7702,6 +7445,8 @@ With the await keyword in `secondFunction`, we literally pause the execution of This means that it waited for the `myPromise` to resolve with the value `I have resolved`, and only once that happened, we moved to the next line: `second` got logged. +
+ @@ -7720,12 +7465,7 @@ for (let item of set) { } ``` -- A: `3`, `NaN`, `NaN` -- B: `3`, `7`, `NaN` -- C: `3`, `Lydia2`, `[Object object]2` -- D: `"12"`, `Lydia2`, `[Object object]2` - -**Answer: C** +
Answer The `+` operator is not only used for adding numerical values, but we can also use it to concatenate strings. Whenever the JavaScript engine sees that one or more values are not a number, it coerces the number into a string. @@ -7735,6 +7475,8 @@ However, the second one is a string `"Lydia"`. `"Lydia"` is a string and `2` is `{ name: "Lydia" }` is an object. Neither a number nor an object is a string, so it stringifies both. Whenever we stringify a regular object, it becomes `"[Object object]"`. `"[Object object]"` concatenated with `"2"` becomes `"[Object object]2"`. +
+ @@ -7745,17 +7487,14 @@ However, the second one is a string `"Lydia"`. `"Lydia"` is a string and `2` is Promise.resolve(5); ``` -- A: `5` -- B: `Promise {: 5}` -- C: `Promise {: 5}` -- D: `Error` - -**Answer: C** +
Answer We can pass any type of value we want to `Promise.resolve`, either a promise or a non-promise. The method itself returns a promise with the resolved value. If you pass a regular function, it'll be a resolved promise with a regular value. If you pass a promise, it'll be a resolved promise with the resolved value of that passed promise. In this case, we just passed the numerical value `5`. It returns a resolved promise with the value `5`. +
+ @@ -7776,12 +7515,7 @@ const person = { name: "Lydia" }; compareMembers(person); ``` -- A: `Not the same!` -- B: `They are the same!` -- C: `ReferenceError` -- D: `SyntaxError` - -**Answer: B** +
Answer Objects are passed by reference. When we check objects for strict equality (`===`), we\'re comparing their references. @@ -7791,6 +7525,8 @@ This means that both values have a reference to the same spot in memory, thus th The code block in the `else` statement gets run, and `They are the same!` gets logged. +
+ @@ -7811,124 +7547,15 @@ const colors = ["pink", "red", "blue"]; console.log(colorConfig.colors[1]); ``` -- A: `true` -- B: `false` -- C: `undefined` -- D: `TypeError` - -**Answer: D** +
Answer In JavaScript, we have two ways to access properties on an object: bracket notation, or dot notation. In this example, we use dot notation (`colorConfig.colors`) instead of bracket notation (`colorConfig["colors"]`). With dot notation, JavaScript tries to find the property on the object with that exact name. In this example, JavaScript tries to find a property called `colors` on the `colorConfig` object. There is no proprety called `colors`, so this returns `undefined`. Then, we try to access the value of the first element by using `[1]`. We cannot do this on a value that\'s `undefined`, so it throws a `TypeError`: `Cannot read property '1' of undefined`. -JavaScript interprets (or unboxes) statements. When we use bracket notation, it sees the first opening bracket `[` and keeps going until it finds the closing bracket `]`. Only then, it will evaluate the statement. If we would've used `colorConfig[colors[1]]`, it would have returned the value of the `red` property on the `colorConfig` object. - - - -## Q. What is its value? - -```javascript -console.log("❤️" === "❤️"); -``` - -- A: `true` -- B: `false` - -**Answer: A** - -Under the hood, emojis are unicodes. The unicodes for the heart emoji is `"U+2764 U+FE0F"`. These are always the same for the same emojis, so we\'re comparing two equal strings to each other, which returns true. - - - -## Q. Which of these methods modifies the original array? - -```javascript -const emojis = ["✨", "🥑", "😍"]; - -emojis.map((x) => x + "✨"); -emojis.filter((x) => x !== "🥑"); -emojis.find((x) => x !== "🥑"); -emojis.reduce((acc, cur) => acc + "✨"); -emojis.slice(1, 2, "✨"); -emojis.splice(1, 2, "✨"); -``` - -- A: `All of them` -- B: `map` `reduce` `slice` `splice` -- C: `map` `slice` `splice` -- D: `splice` - -**Answer: D** - -With `splice` method, we modify the original array by deleting, replacing or adding elements. In this case, we removed 2 items from index 1 (we removed `'🥑'` and `'😍'`) and added the ✨ emoji instead. - -`map`, `filter` and `slice` return a new array, `find` returns an element, and `reduce` returns a reduced value. - - - -## Q. What is the output? - -```javascript -const food = ["🍕", "🍫", "🥑", "🍔"]; -const info = { favoriteFood: food[0] }; - -info.favoriteFood = "🍝"; - -console.log(food); -``` - -- A: `['🍕', '🍫', '🥑', '🍔']` -- B: `['🍝', '🍫', '🥑', '🍔']` -- C: `['🍝', '🍕', '🍫', '🥑', '🍔']` -- D: `ReferenceError` - -**Answer: A** - -We set the value of the `favoriteFood` property on the `info` object equal to the string with the pizza emoji, `'🍕'`. A string is a primitive data type. In JavaScript, primitive data types act by reference - -In JavaScript, primitive data types (everything that\'s not an object) interact by _value_. In this case, we set the value of the `favoriteFood` property on the `info` object equal to the value of the first element in the `food` array, the string with the pizza emoji in this case (`'🍕'`). A string is a primitive data type, and interact by value (see my [blogpost](https://www.theavocoder.com/complete-javascript/2018/12/21/by-value-vs-by-reference) if you\'re interested in learning more) - -Then, we change the value of the `favoriteFood` property on the `info` object. The `food` array hasn\'t changed, since the value of `favoriteFood` was merely a _copy_ of the value of the first element in the array, and doesn\'t have a reference to the same spot in memory as the element on `food[0]`. When we log food, it\'s still the original array, `['🍕', '🍫', '🥑', '🍔']`. - - - -## Q. What does this method do? - -```javascript -JSON.parse(); -``` - -- A: Parses JSON to a JavaScript value -- B: Parses a JavaScript object to JSON -- C: Parses any JavaScript value to JSON -- D: Parses JSON to a JavaScript object only - -**Answer: A** - -With the `JSON.parse()` method, we can parse JSON string to a JavaScript value. +JavaScript interprets (or unboxes) statements. When we use bracket notation, it sees the first opening bracket `[` and keeps going until it finds the closing bracket `]`. Only then, it will evaluate the statement. If we would\'ve used `colorConfig[colors[1]]`, it would have returned the value of the `red` property on the `colorConfig` object. -```javascript -// Stringifying a number into valid JSON, then parsing the JSON string to a JavaScript value: -const jsonNumber = JSON.stringify(4); // '4' -JSON.parse(jsonNumber); // 4 - -// Stringifying an array value into valid JSON, then parsing the JSON string to a JavaScript value: -const jsonArray = JSON.stringify([1, 2, 3]); // '[1, 2, 3]' -JSON.parse(jsonArray); // [1, 2, 3] - -// Stringifying an object into valid JSON, then parsing the JSON string to a JavaScript value: -const jsonArray = JSON.stringify({ name: "Lydia" }); // '{"name":"Lydia"}' -JSON.parse(jsonArray); // { name: 'Lydia' } -``` +
↥ back to top @@ -7947,18 +7574,13 @@ function getName() { getName(); ``` -- A: Lydia -- B: Sarah -- C: `undefined` -- D: `ReferenceError` - -**Answer: D** +
Answer Each function has its own _execution context_ (or _scope_). The `getName` function first looks within its own context (scope) to see if it contains the variable `name` we\'re trying to access. In this case, the `getName` function contains its own `name` variable: we declare the variable `name` with the `let` keyword, and with the value of `'sarah'`. Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don\'t get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`. -If we wouldn\'t have declared the `name` variable within the `getName` function, the javascript engine would've looked down the _scope chain_. The outer scope has a variable called `name` with the value of `Lydia`. In that case, it would've logged `Lydia`. +If we wouldn\'t have declared the `name` variable within the `getName` function, the javascript engine would\'ve looked down the _scope chain_. The outer scope has a variable called `name` with the value of `Lydia`. In that case, it would\'ve logged `Lydia`. ```javascript let name = "Lydia"; @@ -7970,6 +7592,8 @@ function getName() { getName(); // Lydia ``` +
+ @@ -7992,12 +7616,7 @@ console.log(one.next().value); console.log(two.next().value); ``` -- A: `a` and `a` -- B: `a` and `undefined` -- C: `['a', 'b', 'c']` and `a` -- D: `a` and `['a', 'b', 'c']` - -**Answer: C** +
Answer With the `yield` keyword, we `yield` values in a generator function. With the `yield*` keyword, we can yield values from another generator function, or iterable object (for example an array). @@ -8017,6 +7636,8 @@ console.log(two.next().value); // 'c' console.log(two.next().value); // undefined ``` +
+ @@ -8027,15 +7648,12 @@ console.log(two.next().value); // undefined console.log(`${((x) => x)("I love")} to program`); ``` -- A: `I love to program` -- B: `undefined to program` -- C: `${(x => x)('I love') to program` -- D: `TypeError` - -**Answer: A** +
Answer Expressions within template literals are evaluated first. This means that the string will contain the returned value of the expression, the immediately invoked function `(x => x)('I love')` in this case. We pass the value `'I love'` as an argument to the `x => x` arrow function. `x` is equal to `'I love'`, which gets returned. This results in `I love to program`. +
+ @@ -8052,15 +7670,12 @@ let config = { config = null; ``` -- A: The `setInterval` callback won\'t be invoked -- B: The `setInterval` callback gets invoked once -- C: The `setInterval` callback will still be called every second -- D: We never invoked `config.alert()`, config is `null` - -**Answer: C** +
Answer Normally when we set objects equal to `null`, those objects get _garbage collected_ as there is no reference anymore to that object. However, since the callback function within `setInterval` is an arrow function (thus bound to the `config` object), the callback function still holds a reference to the `config` object. As long as there is a reference, the object won\'t get garbage collected. Since it\'s not garbage collected, the `setInterval` callback function will still get invoked every 1000ms (1s). +
+ @@ -8081,18 +7696,15 @@ myMap.get(myFunc); myMap.get(() => "greeting"); ``` -- A: 1 -- B: 2 -- C: 2 and 3 -- D: All of them - -**Answer: B** +
Answer When adding a key/value pair using the `set` method, the key will be the value of the first argument passed to the `set` function, and the value will be the second argument passed to the `set` function. The key is the _function_ `() => 'greeting'` in this case, and the value `'Hello world'`. `myMap` is now `{ () => 'greeting' => 'Hello world!' }`. 1 is wrong, since the key is not `'greeting'` but `() => 'greeting'`. 3 is wrong, since we\'re creating a new function by passing it as a parameter to the `get` method. Object interact by _reference_. Functions are objects, which is why two functions are never strictly equal, even if they are identical: they have a reference to a different spot in memory. +
+ @@ -8117,12 +7729,7 @@ changeAgeAndName(); console.log(person); ``` -- A: `{name: "Sarah", age: 22}` -- B: `{name: "Sarah", age: 23}` -- C: `{name: "Lydia", age: 22}` -- D: `{name: "Lydia", age: 23}` - -**Answer: C** +
Answer Both the `changeAge` and `changeAgeAndName` functions have a default parameter, namely a _newly_ created object `{ ...person }`. This object has copies of all the key/values in the `person` object. @@ -8130,6 +7737,8 @@ First, we invoke the `changeAge` function and pass the `person` object as its ar Then, we invoke the `changeAgeAndName` function, however we don\'t pass a parameter. Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it\'s a new object, it doesn\'t affect the values of the properties on the `person` object. `person` is still equal to `{ name: "Lydia", age: 22 }`. +
+ @@ -8137,9 +7746,9 @@ Then, we invoke the `changeAgeAndName` function, however we don\'t pass a parame ## Q. Predict the output ```js -if(2 == true) // returns false +if(2 == true) -if(2 == false) // returns false +if(2 == false) ```
@@ -8158,11 +7767,6 @@ function find_max(nums) { } return max_num; } - -// a.) num = max_num -// b.) max_num += 1 -// c.) max_num = num -// d.) max_num += num ``` **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-code-practice-xjw5n3)** From 5a8955461794a79d36efe6266a4e7cec9fa14629 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 23 Oct 2022 13:02:23 +0530 Subject: [PATCH 034/117] Update README.md --- README.md | 186 ++++++++++++++++++++---------------------------------- 1 file changed, 67 insertions(+), 119 deletions(-) diff --git a/README.md b/README.md index 9bda1da..8fd64e5 100644 --- a/README.md +++ b/README.md @@ -2982,7 +2982,7 @@ This is why changing the property of `arrB[0]` in `arrB` will also change the `a
Answer -_Answer:_ ReferenceError: employeeId is not defined +ReferenceError: employeeId is not defined
@@ -2999,7 +2999,7 @@ var employeeId = "19000";
Answer -_Answer:_ undefined +undefined
@@ -3019,7 +3019,7 @@ var employeeId = "1234abe";
Answer -_Answer:_ 2) undefined +undefined
@@ -3065,7 +3065,7 @@ undefined
Answer -_Answer:_ undefined +undefined
@@ -3087,7 +3087,7 @@ console.log(employeeId);
Answer -_Answer:_ '123bcd' +'123bcd'
@@ -3113,7 +3113,7 @@ console.log(employeeId);
Answer -_Answer:_ 'abc123' +'abc123'
@@ -3139,7 +3139,7 @@ foo();
Answer -_Answer:_ 'function' +'function'
@@ -3164,7 +3164,7 @@ foo();
Answer -_Answer:_ 1) undefined +1) undefined
@@ -3191,7 +3191,7 @@ _Answer:_ 1) undefined
Answer -_Answer:_ function function +function function
@@ -3222,7 +3222,7 @@ _Answer:_ function function
Answer -_Answer:_ ["name", "salary", "country", "phoneNo"] +["name", "salary", "country", "phoneNo"]
@@ -3253,7 +3253,7 @@ _Answer:_ ["name", "salary", "country", "phoneNo"]
Answer -_Answer:_ ["name", "salary", "country"] +["name", "salary", "country"]
@@ -3280,7 +3280,7 @@ _Answer:_ ["name", "salary", "country"]
Answer -_Answer:_ 2) false false +false false
@@ -3301,7 +3301,7 @@ _Answer:_ 2) false false
Answer -_Answer:_ false false +false false
@@ -3326,7 +3326,7 @@ _Answer:_ false false
Answer -_Answer:_ 2) false false +false false
@@ -3349,7 +3349,7 @@ _Answer:_ 2) false false
Answer -_Answer:_ 2) false false +false false
@@ -3372,7 +3372,7 @@ _Answer:_ 2) false false
Answer -_Answer:_ true true +true true
@@ -3397,7 +3397,7 @@ _Answer:_ true true
Answer -_Answer:_ true true true true +true true true true
@@ -3421,7 +3421,7 @@ _Answer:_ true true true true
Answer -_Answer:_ bar bar +bar bar
@@ -3447,7 +3447,7 @@ _Answer:_ bar bar
Answer -_Answer:_ foo foo +foo foo
@@ -3473,7 +3473,7 @@ _Answer:_ foo foo
Answer -_Answer:_ undefined undefined +undefined undefined
@@ -3493,7 +3493,7 @@ _Answer:_ undefined undefined
Answer -_Answer:_ 3) ["100"] 1 +["100"] 1
@@ -3517,7 +3517,7 @@ _Answer:_ 3) ["100"] 1
Answer -_Answer:_ [] [] [Array[5]] 1 +[] [] [Array[5]] 1
@@ -3538,7 +3538,7 @@ _Answer:_ [] [] [Array[5]] 1
Answer -_Answer:_ 11 +11
@@ -3559,7 +3559,7 @@ _Answer:_ 11
Answer -_Answer:_ 6 +6
@@ -3580,7 +3580,7 @@ _Answer:_ 6
Answer -_Answer:_ [ 'dog', 'rat', 'goat', 'cow', 'horse', 'cat' ] + [ 'dog', 'rat', 'goat', 'cow', 'horse', 'cat' ]
@@ -3602,7 +3602,7 @@ _Answer:_ [ 'dog', 'rat', 'goat', 'cow', 'horse', 'cat' ]
Answer -_Answer:_ 1) 1 -1 -1 4 +1) 1 -1 -1 4
@@ -3623,7 +3623,7 @@ _Answer:_ 1) 1 -1 -1 4
Answer -_Answer:_ 1 6 -1 +1 6 -1
@@ -3651,7 +3651,7 @@ _Answer:_ 1 6 -1
Answer -_Answer:_ [ 2, 4, 8, 12, 16 ] true +[ 2, 4, 8, 12, 16 ] true
@@ -3678,7 +3678,6 @@ _Answer:_ [ 2, 4, 8, 12, 16 ] true
Answer -_Answer:_ [ 2, '12', true ] [ 2, '12', true ] [ 2, '12', true ] @@ -3705,7 +3704,6 @@ _Answer:_
Answer -_Answer:_ [ 'bar', 'john', 'ritz' ] [ 'bar', 'john' ] [ 'foo', 'bar', 'john', 'ritz' ] @@ -3731,7 +3729,7 @@ _Answer:_
Answer -_Answer:_ [ 'bar', 'john' ] [] [ 'foo' ] +[ 'bar', 'john' ] [] [ 'foo' ]
@@ -3751,7 +3749,7 @@ _Answer:_ [ 'bar', 'john' ] [] [ 'foo' ]
Answer -_Answer:_ [ 15, 16, 2, 23, 42, 8 ] +[ 15, 16, 2, 23, 42, 8 ]
@@ -3777,7 +3775,6 @@ console.log(funcA());
Answer -_Answer:_ funcA innerFunc1 innerFunA11 @@ -3803,7 +3800,7 @@ console.log(obj.innerMessage);
Answer -_Answer:_ undefined true +undefined true
@@ -3826,7 +3823,7 @@ console.log(obj.innerMessage());
Answer -_Answer:_ Hello +Hello
@@ -3850,7 +3847,7 @@ console.log(obj.innerMessage());
Answer -_Answer:_ undefined +undefined
@@ -3875,7 +3872,7 @@ console.log(obj.innerMessage());
Answer -_Answer:_ 'Hello' +'Hello'
@@ -3896,7 +3893,7 @@ console.log(myFunc());
Answer -_Answer:_ undefined +undefined
@@ -3917,7 +3914,7 @@ console.log(myFunc());
Answer -_Answer:_ 'Hi John' +'Hi John'
@@ -3937,7 +3934,7 @@ console.log(myFunc());
Answer -_Answer:_ 'Hi John' +'Hi John'
@@ -3958,7 +3955,7 @@ console.log(myFunc("a", "b", "c", "d"));
Answer -_Answer:_ 2 2 2 +2 2 2
@@ -3979,7 +3976,7 @@ console.log(myFunc("a", "b", "c", "d"));
Answer -_Answer:_ 0 2 4 + 0 2 4
@@ -4011,7 +4008,7 @@ Person.displayName();
Answer -_Answer:_ John Person +John Person
@@ -4037,7 +4034,7 @@ console.log(userInfo.userName);
Answer -_Answer:_ 12345678 undefined +12345678 undefined
@@ -4057,7 +4054,7 @@ console.log(Employee.employeeId);
Answer -_Answer:_ undefined +undefined
@@ -4082,7 +4079,7 @@ console.log(new Employee().employeeId);
Answer -_Answer:_ bq1uy 1BJKSJ bq1uy +bq1uy 1BJKSJ bq1uy
@@ -4106,7 +4103,7 @@ var employeeId = "aq123";
Answer -_Answer:_ foo123 aq123 +foo123 aq123
@@ -4128,7 +4125,7 @@ _Answer:_ foo123 aq123
Answer -_Answer:_ [ 'W', 'o', 'r', 'l', 'd' ] +[ 'W', 'o', 'r', 'l', 'd' ]
@@ -4162,7 +4159,7 @@ _Answer:_ [ 'W', 'o', 'r', 'l', 'd' ]
Answer -_Answer:_ Total amount left in account: 5600 Total amount left in account: 5300 +Total amount left in account: 5600 Total amount left in account: 5300
@@ -4197,7 +4194,7 @@ _Answer:_ Total amount left in account: 5600 Total amount left in account: 5300
Answer -_Answer:_ 5600 5300 5100 +5600 5300 5100
@@ -4232,7 +4229,7 @@ _Answer:_ 5600 5300 5100
Answer -_Answer:_ 3600 3300 3100 +3600 3300 3100
@@ -4252,7 +4249,7 @@ _Answer:_ 3600 3300 3100
Answer -_Answer:_ 1) Hello John +Hello John
@@ -4279,7 +4276,7 @@ getDataFromServer("www.google.com").then(function (name) {
Answer -_Answer:_ John +John
@@ -4322,7 +4319,6 @@ _Answer:_ John
Answer -_Answer:_ [ 2, 8, 15, 16, 23, 42 ] [ 2, 8, 15, 16, 23, 42 ] [ 2, 8, 15, 16, 23, 42 ] @@ -4350,7 +4346,7 @@ _Answer:_
Answer -_Answer:_ Uncaught TypeError: Cannot read property 'fullName' of undefined +Uncaught TypeError: Cannot read property 'fullName' of undefined
@@ -4371,7 +4367,7 @@ console.log(numb);
Answer -_Answer:_ 5 +5
@@ -4392,7 +4388,7 @@ console.log(numb);
Answer -_Answer:_ undefined +undefined
@@ -4420,7 +4416,7 @@ console.log(mul(2)(3)[1](4));
Answer -_Answer:_ 6, 10 +6, 10
@@ -4447,7 +4443,7 @@ console.log(mul(2)(3).sum(4));
Answer -_Answer:_ 6, 10 +6, 10
@@ -4474,7 +4470,7 @@ console.log(mul(2)(3)(4)(5)(6));
Answer -_Answer:_ 720 +720
@@ -4490,7 +4486,7 @@ var foo = 10 + "20";
Answer -_Answer:_ `'1020'`, because of type coercion from Number to String +`'1020'`, because of type coercion from Number to String
@@ -4507,7 +4503,7 @@ add(2)(5); // 7
Answer -_Answer:_ A general solution for any number of parameters +A general solution for any number of parameters ```javascript "use strict"; @@ -4546,7 +4542,7 @@ add()()(2)(5); // 7
Answer -_Answer:_ It\'s actually a reverse method for a string - `'goh angasal a m\'i'` +It\'s actually a reverse method for a string - `'goh angasal a m\'i'`
@@ -4562,7 +4558,7 @@ window.foo || (window.foo = "bar");
Answer -_Answer:_ Always `'bar'` +Always `'bar'`
@@ -4604,7 +4600,7 @@ foo.push(2);
Answer -_Answer:_ `.push` is mutable - `2` +`.push` is mutable - `2`
@@ -4622,7 +4618,7 @@ foo.x = foo = { n: 2 };
Answer -_Answer:_ `undefined`. Rather, `bar.x` is `{n: 2}`. +`undefined`. Rather, `bar.x` is `{n: 2}`. `foo.x = foo = {n: 2}` is the same as `foo.x = (foo = {n: 2})`. It is because a left term is first referenced and then a right term is evaluated when an @@ -4648,7 +4644,7 @@ console.log("three");
Answer -_Answer:_ `one`, `three` and `two`. It\'s because `console.log('two');` will be +`one`, `three` and `two`. It\'s because `console.log('two');` will be invoked in the next event loop.
@@ -4677,7 +4673,7 @@ var foo = 10 + "20";
Answer -_Answer:_ `'1020'`, because of type coercion from Number to String +`'1020'`, because of type coercion from Number to String
@@ -4694,7 +4690,7 @@ if( !(x > 100) ) {...}
Answer -_Answer:_ `NaN <= 100` is `false` and `NaN > 100` is also false, so if the value of `x` is `NaN`, the statements are not the same. +`NaN <= 100` is `false` and `NaN > 100` is also false, so if the value of `x` is `NaN`, the statements are not the same. The same holds true for any value of x that being converted to Number, returns NaN, e.g.: `undefined`, `[1,2,5]`, `{a:22}`, etc. @@ -4990,7 +4986,7 @@ sayHi();
Answer -**Answer:** + Within the function, we first declare the `name` variable with the `var` keyword. This means that the variable gets hoisted (memory space is set up during the creation phase) with the default value of `undefined`, until we actually get to the line where we define the variable. We haven\'t defined the variable yet on the line where we try to log the `name` variable, so it still holds the value of `undefined`. @@ -5016,8 +5012,6 @@ for (let i = 0; i < 3; i++) {
Answer -**Answer:** - Because of the event queue in JavaScript, the `setTimeout` callback function is called _after_ the loop has been executed. Since the variable `i` in the first loop was declared using the `var` keyword, this value was global. During the loop, we incremented the value of `i` by `1` each time, using the unary operator `++`. By the time the `setTimeout` callback function was invoked, `i` was equal to `3` in the first example. In the second loop, the variable `i` was declared using the `let` keyword: variables declared with the `let` (and `const`) keyword are block-scoped (a block is anything between `{ }`). During each iteration, `i` will have a new value, and each value is scoped inside the loop. @@ -5045,8 +5039,6 @@ console.log(shape.perimeter());
Answer -**Answer:** - Note that the value of `diameter` is a regular function, whereas the value of `perimeter` is an arrow function. With arrow functions, the `this` keyword refers to its current surrounding scope, unlike regular functions! This means that when we call `perimeter`, it doesn\'t refer to the shape object, but to its surrounding scope (window for example). @@ -5068,8 +5060,6 @@ There is no value `radius` on that object, which returns `undefined`.
Answer -**Answer:** - The unary plus tries to convert an operand to a number. `true` is `1`, and `false` is `0`. The string `'Lydia'` is a truthy value. What we\'re actually asking, is "is this truthy value falsy?". This returns `false`. @@ -5095,8 +5085,6 @@ const mouse = {
Answer -**Answer:** - In JavaScript, all object keys are strings (unless it\'s a Symbol). Even though we might not _type_ them as strings, they are always converted into strings under the hood. JavaScript interprets (or unboxes) statements. When we use bracket notation, it sees the first opening bracket `[` and keeps going until it finds the closing bracket `]`. Only then, it will evaluate the statement. @@ -5124,8 +5112,6 @@ console.log(d.greeting);
Answer -**Answer:** - In JavaScript, all objects interact by _reference_ when setting them equal to each other. First, variable `c` holds a value to an object. Later, we assign `d` with the same reference that `c` has to the object. @@ -5154,8 +5140,6 @@ console.log(b === c);
Answer -**Answer:** - `new Number()` is a built-in function constructor. Although it looks like a number, it\'s not really a number: it has a bunch of extra features and is an object. When we use the `==` operator, it only checks whether it has the same _value_. They both have the value of `3`, so it returns `true`. @@ -5188,8 +5172,6 @@ console.log(freddie.colorChange("orange"));
Answer -**Answer:** - The `colorChange` function is static. Static methods are designed to live only on the constructor in which they are created, and cannot be passed down to any children. Since `freddie` is a child, the function is not passed down, and not available on the `freddie` instance: a `TypeError` is thrown.
@@ -5208,8 +5190,6 @@ console.log(greetign);
Answer -**Answer:** - It logs the object, because we just created an empty object on the global object! When we mistyped `greeting` as `greetign`, the JS interpreter actually saw this as `global.greetign = {}` (or `window.greetign = {}` in a browser). In order to avoid this, we can use `"use strict"`. This makes sure that you have declared a variable before setting it equal to anything. @@ -5232,8 +5212,6 @@ bark.animal = "dog";
Answer -**Answer:** - This is possible in JavaScript, because functions are objects! (Everything besides primitive types are objects) A function is a special type of object. The code you write yourself isn\'t the actual function. The function is an object with properties. This property is invocable. @@ -5262,8 +5240,6 @@ console.log(member.getFullName());
Answer -**Answer:** - You can\'t add properties to a constructor like you can with regular objects. If you want to add a feature to all objects at once, you have to use the prototype instead. So in this case, ```js @@ -5297,8 +5273,6 @@ console.log(sarah);
Answer -**Answer:** - For `sarah`, we didn\'t use the `new` keyword. When using `new`, it refers to the new empty object we create. However, if you don\'t add `new` it refers to the **global object**! We said that `this.firstName` equals `"Sarah"` and `this.lastName` equals `"Smith"`. What we actually did, is defining `global.firstName = 'Sarah'` and `global.lastName = 'Smith'`. `sarah` itself is left `undefined`, since we don\'t return a value from the `Person` function. @@ -5359,8 +5333,6 @@ sum(1, "2");
Answer -**Answer:** - JavaScript is a **dynamically typed language**: we don\'t specify what types certain variables are. Values can automatically be converted into another type without you knowing, which is called _implicit type coercion_. **Coercion** is converting from one type into another. In this example, JavaScript converts the number `1` into a string, in order for the function to make sense and return a value. During the addition of a numeric type (`1`) and a string type (`'2'`), the number is treated as a string. We can concatenate strings like `"Hello" + "World"`, so What is happening here is `"1" + "2"` which returns `"12"`. @@ -5382,8 +5354,6 @@ console.log(number);
Answer -**Answer:** - The **postfix** unary operator `++`: 1. Returns the value (this returns `0`) @@ -5419,8 +5389,6 @@ getPersonInfo`${person} is ${age} years old`;
Answer -**Answer:** - If you use tagged template literals, the value of the first argument is always an array of the string values. The remaining arguments get the values of the passed expressions!
@@ -5447,8 +5415,6 @@ checkAge({ age: 18 });
Answer -**Answer:** - When testing equality, primitives are compared by their _value_, while objects are compared by their _reference_. JavaScript checks if the objects have a reference to the same location in memory. The two objects that we are comparing don\'t have that: the object we passed as a parameter refers to a different location in memory than the object we used in order to check equality. @@ -5473,8 +5439,6 @@ getAge(21);
Answer -**Answer:** - The rest parameter (`...args`.) lets us "collect" all remaining arguments into an array. An array is an object, so `typeof args` returns `"object"`
@@ -5497,8 +5461,6 @@ getAge();
Answer -**Answer:** - With `"use strict"`, you can make sure that you don\'t accidentally declare global variables. We never declared the variable `age`, and since we use `"use strict"`, it will throw a reference error. If we didn\'t use `"use strict"`, it would have worked, since the property `age` would have gotten added to the global object.
@@ -5515,8 +5477,6 @@ const sum = eval("10*10+5");
Answer -**Answer:** - `eval` evaluates codes that\'s passed as a string. If it\'s an expression, like in this case, it evaluates the expression. The expression is `10 * 10 + 5`. This returns the number `105`.
@@ -5533,7 +5493,7 @@ sessionStorage.setItem("cool_secret", 123);
Answer -**Answer:** + The data stored in `sessionStorage` is removed after closing the _tab_. @@ -5556,8 +5516,6 @@ console.log(num);
Answer -**Answer:** - With the `var` keyword, you can declare multiple variables with the same name. The variable will then hold the latest value. You cannot do this with `let` or `const` since they\'re block-scoped. @@ -5581,8 +5539,6 @@ set.has(1);
Answer -**Answer:** - All object keys (excluding Symbols) are strings under the hood, even if you don\'t type it yourself as a string. This is why `obj.hasOwnProperty('1')` also returns true. It doesn\'t work that way for a set. There is no `'1'` in our set: `set.has('1')` returns `false`. It has the numeric type `1`, `set.has(1)` returns `true`. @@ -5602,8 +5558,6 @@ console.log(obj);
Answer -**Answer:** - If you have two keys with the same name, the key will be replaced. It will still be in its first position, but with the last specified value.
@@ -5641,8 +5595,6 @@ for (let i = 1; i < 5; i++) {
Answer -**Answer:** - The `continue` statement skips an iteration if a certain condition returns `true`.
@@ -5665,8 +5617,6 @@ name.giveLydiaPizza();
Answer -**Answer:** - `String` is a built-in constructor, which we can add properties to. I just added a method to its prototype. Primitive strings are automatically converted into a string object, generated by the string prototype function. So, all strings (string objects) have access to that method!
@@ -5690,8 +5640,6 @@ console.log(a[b]);
Answer -**Answer:** - Object keys are automatically converted into strings. We are trying to set an object as a key to object `a`, with the value of `123`. However, when we stringify an object, it becomes `"[Object object]"`. So what we are saying here, is that `a["Object object"] = 123`. Then, we can try to do the same again. `c` is another object that we are implicitly stringifying. So then, `a["Object object"] = 456`. From a4f7b01bac0e3efe5817e8d47e16cfd57d874427 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 23 Oct 2022 14:51:18 +0530 Subject: [PATCH 035/117] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 8fd64e5..ca931b7 100644 --- a/README.md +++ b/README.md @@ -238,6 +238,8 @@ console.log(reverseString("Hello")); ## Q. Create a Promise to accept car names as argument and send response once the argument matches with Maruti? +
Answer + ```js async function myCars(name) { const promise = new Promise((resolve, reject) => { @@ -253,6 +255,8 @@ myCars("Maruti"); **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-promise-1tmrnp?file=/src/index.js)** +
+ From e684aa7bf8ec248e43bca3ce1cc8461b861e29c5 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 23 Oct 2022 16:26:30 +0530 Subject: [PATCH 036/117] Update README.md --- README.md | 566 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 313 insertions(+), 253 deletions(-) diff --git a/README.md b/README.md index ca931b7..68c2755 100644 --- a/README.md +++ b/README.md @@ -263,7 +263,7 @@ myCars("Maruti"); ## Q. Write code for merge two JavaScript Object dynamically? -Let say you have two objects +**Example:** Let say you have two objects ```js const person = { @@ -287,6 +287,8 @@ merge(person , address); name , age , addressLine1 , addressLine2 , city */ ``` +
Answer + **Method 1: Using ES6, Object.assign method:** ```js @@ -320,9 +322,12 @@ console.log(mergeObject(person, address)); **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-shallow-vs-deep-copy-ik5b7h?file=/src/index.js)** +
## Q. Being told that an unsorted array contains (n - 1) of n consecutive numbers (where the bounds are defined), find the missing number in O(n) time? +**Example:** + ```js // The output of the function should be 8 var arrayOfIntegers = [2, 5, 1, 4, 9, 6, 3, 7]; @@ -330,17 +335,21 @@ var upperBound = 9; var lowerBound = 1; findMissingNumber(arrayOfIntegers, upperBound, lowerBound); // 8 +``` +
Answer + +```js function findMissingNumber(arrayOfIntegers, upperBound, lowerBound) { - // Iterate through array to find the sum of the numbers + var sumOfIntegers = 0; for (var i = 0; i < arrayOfIntegers.length; i++) { sumOfIntegers += arrayOfIntegers[i]; } // Find theoretical sum of the consecutive numbers using a variation of Gauss Sum. - // Formula: [(N * (N + 1)) / 2] - [(M * (M - 1)) / 2]; - // N is the upper bound and M is the lower bound + // Formula: [(Max * (Max + 1)) / 2] - [(Min * (Min - 1)) / 2]; + // Max is the upper bound and Min is the lower bound upperLimitSum = (upperBound * (upperBound + 1)) / 2; lowerLimitSum = (lowerBound * (lowerBound - 1)) / 2; @@ -351,27 +360,36 @@ function findMissingNumber(arrayOfIntegers, upperBound, lowerBound) { } ``` +
+ -## Q. How will you remove duplicates from an array in JavaScript? +## Q. Write a function to remove duplicates from an array in JavaScript? + +
Answer + +**1. Using set():** -**a.) Using set()** ```javascript const names = ['John', 'Paul', 'George', 'Ringo', 'John']; let unique = [...new Set(names)]; console.log(unique); // 'John', 'Paul', 'George', 'Ringo' ``` -**b.) Using filter()** + +**2. Using filter():** + ```javascript const names = ['John', 'Paul', 'George', 'Ringo', 'John']; let x = (names) => names.filter((v,i) => names.indexOf(v) === i) x(names); // 'John', 'Paul', 'George', 'Ringo' ``` -**c.) Using forEach()** + +**3. Using forEach():** + ```javascript const names = ['John', 'Paul', 'George', 'Ringo', 'John']; @@ -388,57 +406,37 @@ function removeDups(names) { removeDups(names); // // 'John', 'Paul', 'George', 'Ringo' ``` -**d.) Using set()** +
-```js -// ES6 Implementation -var array = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; + -Array.from(new Set(array)); // [1, 2, 3, 5, 9, 8] -``` +## Q. Given a string, reverse each word in the sentence -**e.) Using Hashmap** +**Example:** ```js -// ES5 Implementation -var array = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; - -uniqueArray(array); // [1, 2, 3, 5, 9, 8] - -function uniqueArray(array) { - var hashmap = {}; - var unique = []; - - for(var i = 0; i < array.length; i++) { - // If key returns undefined (unique), it is evaluated as false. - if(!hashmap.hasOwnProperty(array[i])) { - hashmap[array[i]] = 1; - unique.push(array[i]); - } - } - - return unique; -} +Input: "Hello World"; +Output: "olleH dlroW"; ``` - - -## Q. Given a string, reverse each word in the sentence +
Answer ```js -var string = "Welcome to this Javascript Guide!"; +const str = "Hello World"; -var reverseEntireSentence = reverseBySeparator(string, ""); +let reverseEntireSentence = reverseBySeparator(str, ""); -var reverseEachWord = reverseBySeparator(reverseEntireSentence, " "); +console.log(reverseBySeparator(reverseEntireSentence, " ")); function reverseBySeparator(string, separator) { return string.split(separator).reverse().join(separator); } ``` +
+ @@ -447,6 +445,8 @@ function reverseBySeparator(string, separator) { Enqueue means to add an element, dequeue to remove an element. +
Answer + ```js var inputStack = []; // First stack var outputStack = []; // Second stack @@ -471,14 +471,20 @@ function dequeue(stackInput, stackOutput) { } ``` +
+ -## Q. How would you use a closure to create a private counter? +## Q. Use a closure to create a private counter? + +**Example:** You can create a function within an outer function (a closure) that allows you to update a private variable but the variable wouldn\'t be accessible from outside the function without the use of a helper function. +
Answer + ```js function counter() { var _counter = 0; @@ -502,14 +508,28 @@ c.add(9); c.retrieve(); // => The counter is currently at: 14 ``` +
+ -## Q. How to divide an array in multiple equal parts in JS? +## Q. Write a function to divide an array into multiple equal parts? + +**Example:** + +```js +Input: [10, 20, 30, 40, 50]; +Length: 3 +Output: +[10, 20, 30] +[40, 50] +``` + +
Answer ```js -const arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; +const arr = [10, 20, 30, 40, 50]; let lenth = 3; function split(len) { @@ -522,6 +542,8 @@ split(lenth); **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/split-array-5od3rz)** +
+ @@ -530,6 +552,13 @@ split(lenth); **Example:** +```js +Input: 1, 100 +Output: 63 +``` + +
Answer + ```js /** * function to return a random number @@ -544,13 +573,29 @@ randomInteger(1, 100); // returns a random integer from 1 to 100 **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-random-integers-yd1cy8?file=/src/index.js)** +
+ -## Q. How to convert Decimal to Binary in JavaScript? +## Q. Write a function to convert decimal number to binary number? + +**Example 01:** + +```js +Input: 10 +Output: 1010 +``` -**Example 01:** Convert Decimal to Binary +**Example 02:** + +```js +Input: 7 +Output: 111 +``` + +
Answer ```js function DecimalToBinary(number) { @@ -581,11 +626,22 @@ console.log(val.toString(16)); // A ==> Hexadecimal Conversion **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-decimal-to-binary-uhyi8t?file=/src/index.js)** +
+ -## Q. How do you make first letter of the string in an uppercase? +## Q. Write a function make first letter of the string in an uppercase? + +**Example:** + +```js +Input: hello world +Output: Hello World +``` + +
Answer You can create a function which uses chain of string methods such as charAt, toUpperCase and slice methods to generate a string with first letter in uppercase. @@ -603,12 +659,30 @@ console.log(capitalizeFirstLetter("hello world")); // Hello World **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-capitalizefirstletter-dpjhky?file=/src/index.js)** +
+ ## Q. Write a function which will test string as a literal and as an object? +**Example 01:** + +```js +Input: const ltrlStr = "Hi I am string literal"; +Output: It is a string literal +``` + +**Example 02:** + +```js +Input: const objStr = new String("Hi I am string object"); +Output: It is an object of string +``` + +
Answer + The `typeof` operator can be use to test string literal and `instanceof` operator to test String object. ```js @@ -633,12 +707,16 @@ console.log(check(objStr)); // It is an object of string **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-literal-vs-object-978dqw?file=/src/index.js)** +
+ ## Q. How do you reversing an array? +
Answer + You can use reverse() method is used reverse the elements in an array. This method is useful to sort an array in descending order. Let us see the usage of reverse() method in an example, ```js @@ -648,17 +726,31 @@ numbers.reverse(); console.log(numbers); // [1, 2, 3, 4 ,5] ``` +
+ ## Q. How do you find min and max value in an array? +**Example:** + +```js +Input: [50, 20, 70, 60, 45, 30]; +Output: +Min: 20 +Max: 70 +``` + +
Answer + You can use `Math.min` and `Math.max` methods on array variable to find the minimum and maximum elements with in an array. Let us create two functions to find the min and max value with in an array, ```js var marks = [50, 20, 70, 60, 45, 30]; + function findMin(arr) { return Math.min.apply(null, arr); } @@ -670,16 +762,21 @@ console.log(findMin(marks)); console.log(findMax(marks)); ``` +
+ ## Q. How do you find min and max values without Math functions? +
Answer + You can write functions which loops through an array comparing each value with the lowest value or highest value to find the min and max values. Let us create those functions to find min an max values, ```js var marks = [50, 20, 70, 60, 45, 30]; + function findMin(arr) { var length = arr.length var min = Infinity; @@ -706,29 +803,7 @@ console.log(findMin(marks)); console.log(findMax(marks)); ``` - - -## Q. Write a script that returns the number of occurrences of character given a string as input? - -```javascript -function countCharacters(str) { - return str - .replace(/ /g, "") - .toLowerCase() - .split("") - .reduce((arr, character) => { - if (character in arr) { - arr[character]++; - } else { - arr[character] = 1; - } - return arr; - }, {}); -} -console.log(countCharacters("the brown fox jumps over the lazy dog")); -``` +
↥ back to top @@ -755,7 +830,7 @@ console.log(isEmpty(obj)); ↥ back to top
-## Q. JavaScript Regular Expression to validate Email +## Q. Write a function to validate an email using regular expression?
Answer @@ -837,7 +912,9 @@ console.log(countCharacters("the brown fox jumps over the lazy dog")); ↥ back to top
-## Q. write a script that return the number of occurrences of a character in paragraph +## Q. Write a function that return the number of occurrences of a character in paragraph? + +
Answer ```javascript function charCount(str, searchChar) { @@ -855,11 +932,15 @@ function charCount(str, searchChar) { console.log(charCount("the brown fox jumps over the lazy dog", "o")); ``` +
+ -## Q. Recursive and non-recursive Factorial function +## Q. Write a recursive and non-recursive Factorial function? + +
Answer ```javascript function recursiveFactorial(n) { @@ -892,11 +973,15 @@ function factorial(n) { console.log(factorial(5)); ``` +
+ -## Q. Recursive and non recursive fibonacci-sequence +## Q. Write a recursive and non recursive fibonacci-sequence? + +
Answer ```javascript // 1, 1, 2, 3, 5, 8, 13, 21, 34 @@ -941,45 +1026,32 @@ function fibonnaci(num, memo = {}) { console.log(fibonnaci(5)); // 8 ``` -## Q. Random Number between min and max - -```javascript -// 5 to 7 -let min = 5; -let max = 7; -console.log(min + Math.floor(Math.random() * (max - min + 1))); -``` +
-## Q. Get HTML form values as JSON object +## Q. Generate a random Number between min and max? -```javascript -// Use the array reduce function with form elements. -const formToJSON = (elements) => - [].reduce.call( - elements, - (data, element) => { - data[element.name] = element.value; - // Check if name and value exist on element - // Check if it checkbox or radio button which can select multiple or single - //check for multiple select options - return data; - }, - {} - ); +
Answer -// pass the elements to above method, to get values -document.querySelector("HTML_FORM_CLASS").elements; +```javascript +// 5 to 7 +let min = 5; +let max = 7; +console.log(min + Math.floor(Math.random() * (max - min + 1))); ``` +
+ -## Q. Reverse the number +## Q. Write a function to reverse the number? + +
Answer ```javascript function reverse(num) { @@ -995,47 +1067,15 @@ function reverse(num) { console.log(reverse(12345)); ``` - - -## Q. Remove Duplicate elements from Array - -```javascript -var arr = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; -function removeDuplicate() { - return ar.reduce((prev, current) => { - //Cannot use includes of array, since it is not supported by many browser - if (prev.indexOf(current) === -1) { - prev.push(current); - } - return prev; - }, []); -} -console.log(removeDuplicate(ar)); - -const removeDuplicates = (arr) => { - let holder = {}; - return arr.filter((el) => { - if (!holder[el]) { - holder[el] = true; - return true; - } - return false; - }); -}; -const arr = [1, 2, 3, 5, 1, 5, 9, 1, 2, 8]; -console.log(removeDuplicates(arr)); // ["1", "2", "3", "5", "8", "9"] // O(n) - -// Es6 -console.log([...new Set(arr)]); -``` +
-## Q. Deep copy of object or clone of object +## Q. How to perform deep copy of object or clone of object? + +
Answer ```javascript function deepExtend(out = {}) { @@ -1070,115 +1110,18 @@ console.log(deepExtend({}, { a: 1, b: { c: 2, d: 3 } }, { e: 4, b: { f: 1 } })); //output : { a: 1, b: {c: 2, d: 3, f: 1}, e: 4 } ``` - - -## Q. Sort ticket based on flying order. - -```javascript -"use strict"; - -function SortTickets(tickets) { - this.tickets = tickets; - - // reverse the order of tickets - this.reverseTickets = {}; - for (let key in this.tickets) { - this.reverseTickets[tickets[key]] = key; - } - - // Get the starting point of ticket - let orderedTivckets = [...this.getStartingPoint()]; - - // Get the ticket destination. - let currentValue = orderedTickets[orderedTickets.length - 1]; - while (currentValue) { - currentValue = this.tickets[currentValue]; - if (currentValue) { - orderedTickets.push(currentValue); - } - } - console.log(orderedTickets); -} - -SortTickets.prototype.getStartingPoint = function () { - for (let tick in this.tickets) { - if (!(tick in this.reverseTickets)) { - return [tick, this.tickets[tick]]; - } - } - return null; -}; - -new SortTickets({ - Athens: "Rio", - Barcelona: "Athens", - London: "NYC", - ND: "Lahore", - NYC: "Barcelona", - Rio: "ND", -}); -``` +
-## Q. Cuncurrent execute function based on input number - -```javascript -function concurrent(num) { - this.queue = []; - this.num = num; -} - -concurrent.prototype.enqueue = function (value) { - this.queue.push(value); -}; - -concurrent.prototype.start = function () { - this.runningCount = 0; - while (this.queue.length > 0) { - if (this.runningCount < this.num) { - this.queue.pop().call(this, () => { - this.runningCount--; - let count = this.runningCount; - if (count === 0) { - this.start(); - } - }); - this.runningCount++; - } - } -}; - -let callback = (done) => { - console.log("starting"); - setTimeout(() => { - console.log("stopped"); - done(); - }, 200); -}; - -let c = new concurrent(2); -c.enqueue(callback); -c.enqueue(callback); -c.enqueue(callback); -c.enqueue(callback); -c.enqueue(callback); -c.enqueue(callback); -c.start(); -``` - - +## Q. Write a function to reverse an array? -## Q. Reversing an array +
Answer ```javascript -let a = [1, 2, 3, 4, 5]; +let a = [10, 20, 30, 40, 50]; //Approach 1: console.log(a.reverse()); @@ -1192,8 +1135,32 @@ let reverse = a.reduce((prev, current) => { console.log(reverse); ``` +
+ + + ## Q. Rotate 2D array +**Example:** + +```js +Input: +[1, 2, 3, 4], +[5, 6, 7, 8], +[9, 10, 11, 12] + + +Output: +[1, 5, 9] +[2, 6, 10] +[3, 7, 11] +[4, 8, 12] +``` + +
Answer + ```javascript const transpose = (arr) => arr[0].map((col, i) => arr.map((row) => row[i])); @@ -1206,8 +1173,16 @@ console.log( ); ``` +
+ + + ## Q. Get Column from 2D Array +
Answer + ```javascript const getColumn = (arr, n) => arr.map((x) => x[n]); @@ -1220,8 +1195,16 @@ const twoDimensionalArray = [ console.log(getColumn(twoDimensionalArray, 1)); //Result = [2,5,8] ``` +
+ + + ## Q. Get top N from array +
Answer + ```javascript function topN(arr, num) { let sorted = arr.sort((a, b) => a - b); @@ -1231,12 +1214,16 @@ function topN(arr, num) { console.log(topN([1, 8, 3, 4, 5], 2)); // [5,8] ``` +
+ ## Q. Get query params from Object +
Answer + ```javascript function getQueryParams(obj) { let parms = ""; @@ -1260,12 +1247,16 @@ console.log( ); ``` +
+ ## Q. Consecutive 1\'s in binary +
Answer + ```javascript function consecutiveOne(num) { let binaryArray = num.toString(2); @@ -1287,12 +1278,16 @@ function consecutiveOne(num) { console.log(consecutiveOne(5)); //1 ``` +
+ ## Q. Spiral travesal of matrix +
Answer + ```javascript var input = [ [1, 2, 3, 4], @@ -1334,12 +1329,16 @@ var spiralTraversal = function (matriks) { console.log(spiralTraversal(input)); // [1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10] ``` +
+ ## Q. Merge Sorted array and sort it. +
Answer + ```javascript function mergeSortedArray(arr1, arr2) { return [...new Set(arr1.concat(arr2))].sort((a, b) => a - b); @@ -1348,12 +1347,16 @@ function mergeSortedArray(arr1, arr2) { console.log(mergeSortedArray([1, 2, 3, 4, 5, 6], [0, 3, 4, 7])); // [0, 1, 2, 3, 4, 5, 6, 7] ``` +
+ ## Q. Anagram of words +
Answer + ```javascript const alphabetize = (word) => word.split("").sort().join(""); @@ -1380,12 +1383,16 @@ console.log( // } ``` +
+ ## Q. Print the largest (maximum) hourglass sum found in 2d array. +
Answer + ```javascript // if arr 6 X 6 then iterate it till 4 X 4 [reduce by two] // if arr 8 X 8 then iterate it till 6 X 6 [reduce by two] @@ -1410,12 +1417,16 @@ function main(arr) { } ``` +
+ ## Q. Transform array of object to array +
Answer + ```javascript let data = [ { vid: "aaa", san: 12 }, @@ -1444,12 +1455,16 @@ console.log(Object.keys(newData).map((key) => newData[key])); // }] ``` +
+ ## Q. Create a private variable or private method in object +
Answer + ```javascript let obj = (function () { function getPrivateFunction() { @@ -1469,12 +1484,16 @@ console.log("p" in obj); // false obj.callPrivateFunction(); // this is private function ``` +
+ ## Q. Flatten only Array not objects +
Answer + ```javascript function flatten(arr, result = []) { arr.forEach((val) => { @@ -1524,12 +1543,16 @@ var list2 = [0, [1, [2, [3, [4, [5]]]]]]; console.log(flattenIterative1(list2)); // [0, 1, 2, 3, 4, 5] ``` +
+ ## Q. Find max difference between two number in Array +
Answer + ```javascript function maxDifference(arr) { let maxDiff = 0; @@ -1546,20 +1569,32 @@ function maxDifference(arr) { console.log(maxDifference([1, 2, 4])); // [1 - 4 ] = 3 ``` +
+ + + ## Q. swap two number in ES6 [destructing] +
Answer + ```javascript -let a = 10, - b = 5; +let a = 10, b = 5; + [a, b] = [b, a]; ``` +
+ ## Q. Panagram ? it means all the 26 letters of alphabet are there +
Answer + ```javascript function panagram(input) { if (input == null) { @@ -1584,12 +1619,16 @@ processData("We promptly judged antique ivory buckles for the next prize"); // p processData("We promptly judged antique ivory buckles for the prize"); // Not Pangram ``` +
+ ## Q. Given two identical DOM trees (not the same one), and a node from one of them find the node in the other one. +
Answer + ```javascript function indexOf(arrLike, target) { return Array.prototype.indexOf.call(arrLike, target); @@ -1619,12 +1658,16 @@ const target = rootA.querySelector(".person__age"); console.log(locateNodeFromPath(rootB, getPath(rootA, target))); ``` +
+ ## Q. Convert a number into a Roman Numeral +
Answer + ```javascript function romanize(num) { let lookup = { @@ -1655,12 +1698,16 @@ function romanize(num) { console.log(romanize(3)); // III ``` +
+ ## Q. check if parenthesis is malformed or not +
Answer + ```javascript function matchParenthesis(str) { let obj = { "{": "}", "(": ")", "[": "]" }; @@ -1687,12 +1734,16 @@ function matchParenthesis(str) { console.log(matchParenthesis("}{{}}"), matchParenthesis("{{[]}}")); // false - true ``` +
+ ## Q. Create Custom Event Emitter class +
Answer + ```javascript class EventEmitter { constructor() { @@ -1725,18 +1776,7 @@ e.on("callme", function (args) { e.emit("callme", ["a", "b"], { firstName: "umesh", lastName: "gohil" }); ``` - - -## Q. Max value from an array - -```javascript -const arr = [-2, -3, 4, 3, 2, 1]; -Math.max(...arr); // Fastest - -Math.max.apply(Math, arr); // Slow -``` +
↥ back to top @@ -1744,6 +1784,8 @@ Math.max.apply(Math, arr); // Slow ## Q. Move all zero\'s to end +
Answer + ```javascript const moveZeroToEnd = (arr) => { for (let i = 0, j = 0; j < arr.length; j++) { @@ -1760,12 +1802,16 @@ const moveZeroToEnd = (arr) => { console.log(moveZeroToEnd([1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0])); // [1, 8, 2, 3, 4, 5, 0, 0, 0, 0, 0] ``` +
+ ## Q. Decode message in matrix [diagional down right, diagional up right] +
Answer + ```javascript const decodeMessage = (mat) => { // check if matrix is null or empty @@ -1809,11 +1855,15 @@ let mat = [ console.log(decodeMessage(mat)); //IROELEA ``` +
+ -## Q. find a pair in array, whose sum is equal to given number. +## Q. find a pair in array, whose sum is equal to given number? + +
Answer ```javascript const hasPairSum = (arr, sum) => { @@ -1860,12 +1910,16 @@ console.log(hasPairSum([6, 4, 3, 8], 8)); // then see if that value exist in difference then return true. ``` +
+ ## Q. Binary Search [Array should be sorted] +
Answer + ```javascript function binarySearch(arr, val) { let startIndex = 0, @@ -1888,12 +1942,16 @@ console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 22)); console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 27)); ``` +
+ ## Q. Write a function to generate Pascal triangle? +
Answer + ```javascript function pascalTriangle(n) { let last = [1], @@ -1910,6 +1968,8 @@ function pascalTriangle(n) { console.log(pascalTriangle(2)); ``` +
+ From 9217e6147035ea6ee5ad8cbc9397a67be135161f Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 23 Oct 2022 16:36:44 +0530 Subject: [PATCH 037/117] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68c2755..1978e41 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ File Extension: jpg ↥ back to top
-## Q. Create a Stopwatch program in javascript? +## Q. Create a stopwatch in javascript?
Answer From d49b812b22df29cb14c926754965337d4c7b1a9e Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 23 Oct 2022 16:58:09 +0530 Subject: [PATCH 038/117] Update README.md --- README.md | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1978e41..7e73b79 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,60 @@ console.log(sum(10)(20)); ↥ back to top
+## Q. Write a function to get the difference between two arrays? + +**Example:** + +```js +Input: +var a1 = ['a', 'b']; +var a2 = ['a', 'b', 'c', 'd']; + +Output: +["c", "d"] +``` + +
Answer + +```js +let arr1 = ['a', 'b']; +let arr2 = ['a', 'b', 'c', 'd']; + +let difference = arr2.filter(x => !arr1.includes(x)); +``` + +
+ + + +## Q. Write a function to accept argument like `[array1].diff([array2]]);` + +**Example:** + +```js +Input: [1,2,3,4,5,6].diff( [3,4,5] ); +Output: [1, 2, 6] +``` + +
Answer + +```js +Array.prototype.diff = function(a) { + return this.filter(function(i) { return a.indexOf(i) < 0; }); +}; + +const dif1 = [1,2,3,4,5,6].diff( [3,4,5] ); +console.log(dif1); // => [1, 2, 6] +``` + +
+ + + ## Q. Validate file size and extension before file upload in JavaScript?
Answer @@ -54,7 +108,6 @@ console.log(sum(10)(20)); ```html - JavaScript File Upload Example + + + +
+ + +
+ + + + + +File Name: pic.jpg +File Size: 1159168 bytes +File Extension: jpg +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-file-upload-fj17kh?file=/index.html)** + +
+ + + +## Q. Create a captcha using javascript? + +
Answer + +```html + + + + JavaScript Captcha Example + + + + +

+ + + +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-captcha-mzyi2n?file=/index.html)** + +
+ + + +## Q. Create a stopwatch in javascript? + +
Answer + +```html + + + + Stopwatch Example + + + +

Time: 00:00:00



+ + + + + + + +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-stopwatch-j6in1i?file=/index.html)** + +

+ + + +## Q. Write a program to reverse a string? + +
Answer + +```javascript +function reverseString(str) { + let stringRev = ""; + for (let i = str.length; i >= 0; i--) { + stringRev = stringRev + str.charAt(i); + } + return stringRev; +} +console.log(reverseString("Hello")); +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-reversestring-sgm1ip?file=/src/index.js)** + +
+ + + +## Q. Create a Promise to accept car names as argument and send response once the argument matches with Maruti? + +
Answer + +```js +async function myCars(name) { + const promise = new Promise((resolve, reject) => { + name === "Maruti" ? resolve(name) : reject(name); + }); + + const result = await promise; + console.log(result); // "resolved!" +} + +myCars("Maruti"); +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-promise-1tmrnp?file=/src/index.js)** + +
+ + + +## Q. Write a function to merge two JavaScript Object dynamically? + +**Example:** + +```js +Input: + +const person = { + name: "Tanvi", + age: 28 +}; + +const address = { + addressLine1: "Some Location x", + addressLine2: "Some Location y", + city: "Bangalore" +}; + +Output: + +// Now person should have 5 properties +name, age, addressLine1, addressLine2, city +``` + +
Answer + +Write merge function which will take two object and add all the own property of second object into first object. + +**Method 1: Using ES6, Object.assign method:** + +```js +const merge = (toObj, fromObj) => Object.assign(toObj, fromObj); + +console.log(merge(person, address)); +// {name: "Tanvi", age: 28, addressLine1: "Some Location x", addressLine2: "Some Location y", city: "Bangalore"} +``` + +**Method 2: Without using built-in function:** + +```js +function mergeObject(toObj, fromObj) { + // Make sure both of the parameter is an object + if (typeof toObj === "object" && typeof fromObj === "object") { + for (var pro in fromObj) { + // Assign only own properties not inherited properties + if (fromObj.hasOwnProperty(pro)) { + toObj[pro] = fromObj[pro]; + } + } + } else { + throw "Merge function can apply only on object"; + } +} + +console.log(mergeObject(person, address)); +// {name: "Tanvi", age: 28, addressLine1: "Some Location x", addressLine2: "Some Location y", city: "Bangalore"} +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-shallow-vs-deep-copy-ik5b7h?file=/src/index.js)** + +
+ + + +## Q. Being told that an unsorted array contains (n - 1) of n consecutive numbers (where the bounds are defined), find the missing number in O(n) time? + +**Example:** + +```js +Input: +array = [2, 5, 1, 4, 9, 6, 3, 7]; +upperBound = 9; +lowerBound = 1; + +Output: +8 +``` + +
Answer + +```js +/** + * Find theoretical sum of the consecutive numbers using a variation of Gauss Sum. + * Formula: [(Max * (Max + 1)) / 2] - [(Min * (Min - 1)) / 2]; + * Max is the upper bound and Min is the lower bound + */ +function findMissingNumber(arrayOfIntegers, upperBound, lowerBound) { + + var sumOfIntegers = 0; + for (var i = 0; i < arrayOfIntegers.length; i++) { + sumOfIntegers += arrayOfIntegers[i]; + } + + upperLimitSum = (upperBound * (upperBound + 1)) / 2; + lowerLimitSum = (lowerBound * (lowerBound - 1)) / 2; + + theoreticalSum = upperLimitSum - lowerLimitSum; + + return theoreticalSum - sumOfIntegers; +} +``` + +
+ + + +## Q. Write a function to remove duplicates from an array in JavaScript? + +
Answer + +**1. Using set():** + +```javascript +const names = ['John', 'Paul', 'George', 'Ringo', 'John']; + +let unique = [...new Set(names)]; +console.log(unique); // 'John', 'Paul', 'George', 'Ringo' +``` + +**2. Using filter():** + +```javascript +const names = ['John', 'Paul', 'George', 'Ringo', 'John']; + +let x = (names) => names.filter((v,i) => names.indexOf(v) === i) +x(names); // 'John', 'Paul', 'George', 'Ringo' +``` + +**3. Using forEach():** + +```javascript +const names = ['John', 'Paul', 'George', 'Ringo', 'John']; + +function removeDups(names) { + let unique = {}; + names.forEach(function(i) { + if(!unique[i]) { + unique[i] = true; + } + }); + return Object.keys(unique); +} + +removeDups(names); // // 'John', 'Paul', 'George', 'Ringo' +``` + +
+ + + +## Q. Given a string, reverse each word in the sentence + +**Example:** + +```js +Input: "Hello World"; +Output: "olleH dlroW"; +``` + +
Answer + +```js +const str = "Hello World"; + +let reverseEntireSentence = reverseBySeparator(str, ""); + +console.log(reverseBySeparator(reverseEntireSentence, " ")); + +function reverseBySeparator(string, separator) { + return string.split(separator).reverse().join(separator); +} +``` + +
+ + + +## Q. Implement enqueue and dequeue using only two stacks + +Enqueue means to add an element, dequeue to remove an element. + +
Answer + +```js +var inputStack = []; // First stack +var outputStack = []; // Second stack + +// For enqueue, just push the item into the first stack +function enqueue(stackInput, item) { + return stackInput.push(item); +} + +function dequeue(stackInput, stackOutput) { + // Reverse the stack such that the first element of the output stack is the + // last element of the input stack. After that, pop the top of the output to + // get the first element that was ever pushed into the input stack + if (stackOutput.length <= 0) { + while(stackInput.length > 0) { + var elementToOutput = stackInput.pop(); + stackOutput.push(elementToOutput); + } + } + + return stackOutput.pop(); +} +``` + +
+ + + +## Q. Use a closure to create a private counter? + +**Example:** + +You can create a function within an outer function (a closure) that allows you to update a private variable but the variable wouldn\'t be accessible from outside the function without the use of a helper function. + +
Answer + +```js +function counter() { + var _counter = 0; + // return an object with several functions that allow you + // to modify the private _counter variable + return { + add: function (increment) { + _counter += increment; + }, + retrieve: function () { + return "The counter is currently at: " + _counter; + }, + }; +} + +// error if we try to access the private variable like below +// _counter; + +// usage of our counter function +var c = counter(); +c.add(5); +c.add(9); + +// now we can access the private variable in the following way +c.retrieve(); // => The counter is currently at: 14 +``` + +
+ + + +## Q. Write a function to divide an array into multiple equal parts? + +**Example:** + +```js +Input: [10, 20, 30, 40, 50]; +Length: 3 +Output: +[10, 20, 30] +[40, 50] +``` + +
Answer + +```js +const arr = [10, 20, 30, 40, 50]; +let lenth = 3; + +function split(len) { + while (arr.length > 0) { + console.log(arr.splice(0, len)); + } +} +split(lenth); +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/split-array-5od3rz)** + +
+ + + +## Q. Write a random integers function to print integers with in a range? + +**Example:** + +```js +Input: 1, 100 +Output: 63 +``` + +
Answer + +```js +/** + * function to return a random number + * between min and max range + */ +function randomInteger(min, max) { + return Math.floor(Math.random() * (max - min + 1) ) + min; +} + +randomInteger(1, 100); // returns a random integer from 1 to 100 +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-random-integers-yd1cy8?file=/src/index.js)** + +
+ + + +## Q. Write a function to convert decimal number to binary number? + +**Example 01:** + +```js +Input: 10 +Output: 1010 +``` + +**Example 02:** + +```js +Input: 7 +Output: 111 +``` + +
Answer + +```js +function DecimalToBinary(number) { + let bin = 0; + let rem, + i = 1; + while (number !== 0) { + rem = number % 2; + number = parseInt(number / 2); + bin = bin + rem * i; + i = i * 10; + } + console.log(`Binary: ${bin}`); +} + +DecimalToBinary(10); +``` + +**Example 02:** Convert Decimal to Binary Using `toString()` + +```js +let val = 10; + +console.log(val.toString(2)); // 1010 ==> Binary Conversion +console.log(val.toString(8)); // 12 ==> Octal Conversion +console.log(val.toString(16)); // A ==> Hexadecimal Conversion +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-decimal-to-binary-uhyi8t?file=/src/index.js)** + +
+ + + +## Q. Write a function make first letter of the string in an uppercase? + +**Example:** + +```js +Input: hello world +Output: Hello World +``` + +
Answer + +You can create a function which uses chain of string methods such as charAt, toUpperCase and slice methods to generate a string with first letter in uppercase. + +```js +function capitalizeFirstLetter(string) { + let arr = string.split(" "); + for (var i = 0; i < arr.length; i++) { + arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1); + } + return arr.join(" "); +} + +console.log(capitalizeFirstLetter("hello world")); // Hello World +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-capitalizefirstletter-dpjhky?file=/src/index.js)** + +
+ + + +## Q. Write a function which will test string as a literal and as an object? + +**Example 01:** + +```js +Input: const ltrlStr = "Hi I am string literal"; +Output: It is a string literal +``` + +**Example 02:** + +```js +Input: const objStr = new String("Hi I am string object"); +Output: It is an object of string +``` + +
Answer + +The `typeof` operator can be use to test string literal and `instanceof` operator to test String object. + +```js +function check(str) { + if (str instanceof String) { + return "It is an object of string"; + } else { + if (typeof str === "string") { + return "It is a string literal"; + } else { + return "another type"; + } + } +} + +var ltrlStr = "Hi I am string literal"; +var objStr = new String("Hi I am string object"); + +console.log(check(ltrlStr)); // It is a string literal +console.log(check(objStr)); // It is an object of string +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-literal-vs-object-978dqw?file=/src/index.js)** + +
+ + + +## Q. How do you reversing an array? + +
Answer + +You can use reverse() method is used reverse the elements in an array. This method is useful to sort an array in descending order. Let us see the usage of reverse() method in an example, + +```js +const fruits = ["Apple", "Banana", "Mango", "Orange"]; + +const reversed = fruits.reverse(); +console.log('reversed:', reversed); +// expected output: "reversed:" Array ["Orange", "Mango", "Banana", "Apple"] +``` + +
+ + + +## Q. How do you find min and max value in an array? + +**Example:** + +```js +Input: [50, 20, 70, 60, 45, 30]; +Output: +Min: 20 +Max: 70 +``` + +
Answer + +You can use `Math.min` and `Math.max` methods on array variable to find the minimum and maximum elements with in an array. +Let us create two functions to find the min and max value with in an array, + +```js +var marks = [50, 20, 70, 60, 45, 30]; + +function findMin(arr) { + return Math.min.apply(null, arr); +} +function findMax(arr) { + return Math.max.apply(null, arr); +} + +console.log(findMin(marks)); +console.log(findMax(marks)); +``` + +
+ + + +## Q. How do you find min and max values without Math functions? + +
Answer + +You can write functions which loops through an array comparing each value with the lowest value or highest value to find the min and max values. Let us create those functions to find min an max values, + +```js +var marks = [50, 20, 70, 60, 45, 30]; + +function findMin(arr) { + var length = arr.length; + var min = Infinity; + while (length--) { + if (arr[length] < min) { + min = arr[length]; + } + } + return min; +} + +function findMax(arr) { + var length = arr.length; + var max = -Infinity; + while (length--) { + if (arr[length] > max) { + max = arr[length]; + } + } + return max; +} + +console.log(findMin(marks)); +console.log(findMax(marks)); +``` + +
+ + + +## Q. Check if object is empty or not using javaScript? + +
Answer + +```javascript +function isEmpty(obj) { + return Object.keys(obj).length === 0; +} + +const obj = {}; +console.log(isEmpty(obj)); +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-isempty-b7n04b?file=/src/index.js)** + +
+ + + +## Q. Write a function to validate an email using regular expression? + +
Answer + +```javascript +function validateEmail(email) { + const re = /\S+@\S+\.\S+/; + return re.test(email); +} + +console.log(validateEmail("pradeep.vwa@gmail.com")); // true +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-validateemail-wfopym?file=/src/index.js)** + +
+ + + +## Q. Use RegEx to test password strength in JavaScript? + +
Answer + +```javascript +let newPassword = "Pq5*@a{J"; +const regularExpression = new RegExp( + "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})" +); + +if (!regularExpression.test(newPassword)) { + alert("Password should contain atleast one number and one special character !"); +} else { + console.log("PASS"); +} + +// Output +PASS +``` + +| RegEx | Description | +| ---------------- |--------------| +| ^ | The password string will start this way | +| (?=.\*[a-z]) | The string must contain at least 1 lowercase alphabetical character | +| (?=.\*[A-Z]) | The string must contain at least 1 uppercase alphabetical character | +| (?=.\*[0-9]) | The string must contain at least 1 numeric character | +| (?=.[!@#\$%\^&]) | The string must contain at least one special character, but we are escaping reserved RegEx characters to avoid conflict | +| (?=.{8,}) | The string must be eight characters or longer | + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-password-strength-cxl8xy)** + +
+ + + +## Q. Write a script that returns the number of occurrences of character given a string as input + +
Answer + +```javascript +function countCharacters(str) { + return str.replace(/ /g, "").toLowerCase().split("").reduce((p, c) => { + if (c in p) { + p[c]++; + } else { + p[c] = 1; + } + return p; + }, {}); +} +console.log(countCharacters("the brown fox jumps over the lazy dog")); +``` + +
+ + + +## Q. Write a function that return the number of occurrences of a character in paragraph? + +
Answer + +```javascript +function charCount(str, searchChar) { + let count = 0; + if (str) { + let stripStr = str.replace(/ /g, "").toLowerCase(); //remove spaces and covert to lowercase + for (let chr of stripStr) { + if (chr === searchChar) { + count++; + } + } + } + return count; +} +console.log(charCount("the brown fox jumps over the lazy dog", "o")); +``` + +
+ + + +## Q. Write a recursive and non-recursive Factorial function? + +
Answer + +```javascript +function recursiveFactorial(n) { + if (n < 1) { + throw Error("Value of N has to be greater then 1"); + } + if (n === 1) { + return 1; + } else { + return n * recursiveFactorial(n - 1); + } +} + +console.log(recursiveFactorial(5)); + +function factorial(n) { + if (n < 1) { + throw Error("Value of N has to be greater then 1"); + } + if (n === 1) { + return 1; + } + let result = 1; + for (let i = 1; i <= n; i++) { + result = result * i; + } + return result; +} + +console.log(factorial(5)); +``` + +
+ + + +## Q. Write a recursive and non recursive fibonacci-sequence? + +
Answer + +```javascript +// 1, 1, 2, 3, 5, 8, 13, 21, 34 + +function recursiveFibonacci(num) { + if (num <= 1) { + return 1; + } else { + return recursiveFibonacci(num - 1) + recursiveFibonacci(num - 2); + } +} + +console.log(recursiveFibonacci(8)); + +function fibonnaci(num) { + let a = 1, + b = 0, + temp; + while (num >= 0) { + temp = a; + a = a + b; + b = temp; + num--; + } + return b; +} + +console.log(fibonnaci(7)); + +// Memoization fibonnaci + +function fibonnaci(num, memo = {}) { + if (num in memo) { + return memo[num]; + } + if (num <= 1) { + return 1; + } + return (memo[num] = fibonnaci(num - 1, memo) + fibonnaci(num - 2, memo)); +} + +console.log(fibonnaci(5)); // 8 +``` + +
+ + + +## Q. Generate a random Number between min and max? + +
Answer + +```javascript +// 5 to 7 +let min = 5; +let max = 7; +console.log(min + Math.floor(Math.random() * (max - min + 1))); +``` + +
+ + + +## Q. Write a function to reverse the number? + +
Answer + +```javascript +function reverse(num) { + let result = 0; + while (num != 0) { + result = result * 10; + result = result + (num % 10); + num = Math.floor(num / 10); + } + return result; +} + +console.log(reverse(12345)); +``` + +
+ + + +## Q. How to perform deep copy of object or clone of object? + +
Answer + +```javascript +function deepExtend(out = {}) { + for (let i = 1; i < arguments.length; i++) { + let obj = arguments[i]; + if (obj == null) + // skip undefined and null [check with double equal not triple] + continue; + + obj = Object(obj); + + for (let key in obj) { + // avoid shadow hasownproperty of parent + if (Object.prototype.hasOwnProperty.call(obj, key)) { + if ( + typeof obj[key] === "object" && + !Array.isArray(obj[key]) && + obj[key] != null + ) + out[key] = deepExtend(out[key], obj[key]); + else out[key] = obj[key]; + } + } + } + return out; +} + +//Alternative if there are no function +let cloneObj = JSON.parse(JSON.stringify(obj)); + +console.log(deepExtend({}, { a: 1, b: { c: 2, d: 3 } }, { e: 4, b: { f: 1 } })); +//output : { a: 1, b: {c: 2, d: 3, f: 1}, e: 4 } +``` + +
+ + + +## Q. Write a function to reverse an array? + +
Answer + +```javascript +let a = [10, 20, 30, 40, 50]; + +//Approach 1: +console.log(a.reverse()); + +//Approach 2: +let reverse = a.reduce((prev, current) => { + prev.unshift(current); + return prev; +}, []); + +console.log(reverse); +``` + +
+ + + +## Q. Rotate 2D array + +**Example:** + +```js +Input: +[1, 2, 3, 4], +[5, 6, 7, 8], +[9, 10, 11, 12] + + +Output: +[1, 5, 9] +[2, 6, 10] +[3, 7, 11] +[4, 8, 12] +``` + +
Answer + +```javascript +const transpose = (arr) => arr[0].map((col, i) => arr.map((row) => row[i])); + +console.log( + transpose([ + [1, 2, 3, 4], + [5, 6, 7, 8], + [9, 10, 11, 12], + ]) +); +``` + +
+ + + +## Q. Get Column from 2D Array + +
Answer + +```javascript +const getColumn = (arr, n) => arr.map((x) => x[n]); + +const twoDimensionalArray = [ + [1, 2, 3], + [4, 5, 6], + [7, 8, 9], +]; + +console.log(getColumn(twoDimensionalArray, 1)); //Result = [2,5,8] +``` + +
+ + + +## Q. Get top N from array + +
Answer + +```javascript +function topN(arr, num) { + let sorted = arr.sort((a, b) => a - b); + return sorted.slice(sorted.length - num, sorted.length); +} + +console.log(topN([1, 8, 3, 4, 5], 2)); // [5,8] +``` + +
+ + + +## Q. Get query params from Object + +
Answer + +```javascript +function getQueryParams(obj) { + let parms = ""; + for (let key in obj) { + if (obj.hasOwnProperty(key)) { + if (parms.length > 0) { + parms += "&"; + } + parms += encodeURI(`${key}=${obj[key]}`); + } + } + return parms; +} + +console.log( + getQueryParams({ + name: "Umesh", + tel: "48289", + add: "3333 emearld st", + }) +); +``` + +
+ + + +## Q. Consecutive 1\'s in binary + +
Answer + +```javascript +function consecutiveOne(num) { + let binaryArray = num.toString(2); + + let maxOccurence = 0, + occurence = 0; + for (let val of binaryArray) { + if (val === "1") { + occurence += 1; + maxOccurence = Math.max(maxOccurence, occurence); + } else { + occurence = 0; + } + } + return maxOccurence; +} +//13 = 1101 = 2 +//5 = 101 = 1 +console.log(consecutiveOne(5)); //1 +``` + +
+ + + +## Q. Spiral travesal of matrix + +
Answer + +```javascript +var input = [ + [1, 2, 3, 4], + [5, 6, 7, 8], + [9, 10, 11, 12], + [13, 14, 15, 16], +]; + +var spiralTraversal = function (matriks) { + let result = []; + var goAround = function (matrix) { + if (matrix.length === 0) { + return; + } + + // right + result = result.concat(matrix.shift()); + + // down + for (var j = 0; j < matrix.length - 1; j++) { + result.push(matrix[j].pop()); + } + + // bottom + result = result.concat(matrix.pop().reverse()); + + // up + for (var k = matrix.length - 1; k > 0; k--) { + result.push(matrix[k].shift()); + } + + return goAround(matrix); + }; + + goAround(matriks); + + return result; +}; +console.log(spiralTraversal(input)); // [1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10] +``` + +
+ + + +## Q. Merge Sorted array and sort it. + +
Answer + +```javascript +function mergeSortedArray(arr1, arr2) { + return [...new Set(arr1.concat(arr2))].sort((a, b) => a - b); +} + +console.log(mergeSortedArray([1, 2, 3, 4, 5, 6], [0, 3, 4, 7])); // [0, 1, 2, 3, 4, 5, 6, 7] +``` + +
+ + + +## Q. Anagram of words + +
Answer + +```javascript +const alphabetize = (word) => word.split("").sort().join(""); + +function groupAnagram(wordsArr) { + return wordsArr.reduce((p, c) => { + const sortedWord = alphabetize(c); + if (sortedWord in p) { + p[sortedWord].push(c); + } else { + p[sortedWord] = [c]; + } + return p; + }, {}); +} + +console.log( + groupAnagram(["map", "art", "how", "rat", "tar", "who", "pam", "shoop"]) +); +// result : { +// amp: ["map", "pam"], +// art: ["art", "rat", "tar"], +// hoops: ["shoop"], +// how: ["how", "who"] +// } +``` + +
+ + + +## Q. Print the largest (maximum) hourglass sum found in 2d array. + +
Answer + +```javascript +// if arr 6 X 6 then iterate it till 4 X 4 [reduce by two] +// if arr 8 X 8 then iterate it till 6 X 6 [reduce by two] +function main(arr) { + let maxScore = -999; + let len = arr.length; + for (let i = 0; i < len - 2; i++) { + for (let j = 0; j < len - 2; j++) { + let total = + arr[i][j] + + arr[i][j + 1] + + arr[i][j + 2] + + arr[i + 1][j + 1] + + arr[i + 2][j] + + arr[i + 2][j + 1] + + arr[i + 2][j + 2]; + + maxScore = Math.max(maxScore, total); + } + } + console.log(maxScore); +} +``` + +
+ + + +## Q. Transform array of object to array + +
Answer + +```javascript +let data = [ + { vid: "aaa", san: 12 }, + { vid: "aaa", san: 18 }, + { vid: "aaa", san: 2 }, + { vid: "bbb", san: 33 }, + { vid: "bbb", san: 44 }, + { vid: "aaa", san: 100 }, +]; + +let newData = data.reduce((acc, item) => { + acc[item.vid] = acc[item.vid] || { vid: item.vid, san: [] }; + acc[item.vid]["san"].push(item.san); + return acc; +}, {}); + +console.log(Object.keys(newData).map((key) => newData[key])); + +// Result +// [[object Object] { +// san: [12, 18, 2, 100], +// vid: "aaa" +// }, [object Object] { +// san: [33, 44], +// vid: "bbb" +// }] +``` + +
+ + + +## Q. Create a private variable or private method in object + +
Answer + +```javascript +let obj = (function () { + function getPrivateFunction() { + console.log("this is private function"); + } + let p = "You are accessing private variable"; + return { + getPrivateProperty: () => { + console.log(p); + }, + callPrivateFunction: getPrivateFunction, + }; +})(); + +obj.getPrivateValue(); // You are accessing private variable +console.log("p" in obj); // false +obj.callPrivateFunction(); // this is private function +``` + +
+ + + +## Q. Flatten only Array not objects + +
Answer + +```javascript +function flatten(arr, result = []) { + arr.forEach((val) => { + if (Array.isArray(val)) { + flatten(val, result); + } else { + result.push(val); + } + }); + return result; +} + +let input = [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; +console.log(flatten(input)); // [1, { a: [2, [3]]}, 4, 5, 6, 7, "hi", 8, 9, 10] + +function flattenIterative(out) { + // iteratively + let result = out; + while (result.some(Array.isArray)) { + result = [].concat.apply([], result); + } + return result; +} +var list1 = [ + [0, 1], + [2, 3], + [4, 5], +]; +console.log(flattenIterative(list1)); // [0, 1, 2, 3, 4, 5] + +function flattenIterative1(current) { + let result = []; + while (current.length) { + let firstValue = current.shift(); + if (Array.isArray(firstValue)) { + current = firstValue.concat(current); + } else { + result.push(firstValue); + } + } + return result; +} + +let input = [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; +console.log(flattenIterative1(input)); +var list2 = [0, [1, [2, [3, [4, [5]]]]]]; +console.log(flattenIterative1(list2)); // [0, 1, 2, 3, 4, 5] +``` + +
+ + + +## Q. Find max difference between two number in Array + +
Answer + +```javascript +function maxDifference(arr) { + let maxDiff = 0; + + for (let i = 0; i < arr.length; i++) { + for (let j = i + 1; j < arr.length; j++) { + let diff = Math.abs(arr[i] - arr[j]); + maxDiff = Math.max(maxDiff, diff); + } + } + return maxDiff; +} + +console.log(maxDifference([1, 2, 4])); // [1 - 4 ] = 3 +``` + +
+ + + +## Q. swap two number in ES6 [destructing] + +
Answer + +```javascript +let a = 10, b = 5; + +[a, b] = [b, a]; +``` + +
+ + + +## Q. Panagram ? it means all the 26 letters of alphabet are there + +
Answer + +```javascript +function panagram(input) { + if (input == null) { + // Check for null and undefined + return false; + } + + if (input.length < 26) { + // if length is less then 26 then it is not + return false; + } + input = input.replace(/ /g, "").toLowerCase().split(""); + let obj = input.reduce((prev, current) => { + if (!(current in prev)) { + prev[current] = current; + } + return prev; + }, {}); + console.log(Object.keys(obj).length === 26 ? "panagram" : "not pangram"); +} +processData("We promptly judged antique ivory buckles for the next prize"); // pangram +processData("We promptly judged antique ivory buckles for the prize"); // Not Pangram +``` + +
+ + + +## Q. Given two identical DOM trees (not the same one), and a node from one of them find the node in the other one. + +
Answer + +```javascript +function indexOf(arrLike, target) { + return Array.prototype.indexOf.call(arrLike, target); +} + +// Given a node and a tree, extract the nodes path +function getPath(root, target) { + var current = target; + var path = []; + while (current !== root) { + let parentNode = current.parentNode; + path.unshift(indexOf(parentNode.childNodes, current)); + current = parentNode; + } + return path; +} + +// Given a tree and a path, let\'s locate a node +function locateNodeFromPath(node, path) { + return path.reduce((root, index) => root.childNodes[index], node); +} + +const rootA = document.querySelector("#root-a"); +const rootB = document.querySelector("#root-b"); +const target = rootA.querySelector(".person__age"); + +console.log(locateNodeFromPath(rootB, getPath(rootA, target))); +``` + +
+ + + +## Q. Convert a number into a Roman Numeral + +
Answer + +```javascript +function romanize(num) { + let lookup = { + M: 1000, + CM: 900, + D: 500, + CD: 400, + C: 100, + XC: 90, + L: 50, + XL: 40, + X: 10, + IX: 9, + V: 5, + IV: 4, + I: 1, + }, + roman = ""; + for (let i in lookup) { + while (num >= lookup[i]) { + roman += i; + num -= lookup[i]; + } + } + return roman; +} + +console.log(romanize(3)); // III +``` + +
+ + + +## Q. check if parenthesis is malformed or not + +
Answer + +```javascript +function matchParenthesis(str) { + let obj = { "{": "}", "(": ")", "[": "]" }; + let result = []; + for (let s of str) { + if (s === "{" || s === "(" || s === "[") { + // All opening brackets + result.push(s); + } else { + if (result.length > 0) { + let lastValue = result.pop(); //pop the last value and compare with key + if (obj[lastValue] !== s) { + // if it is not same then it is not formated properly + return false; + } + } else { + return false; // empty array, there is nothing to pop. so it is not formated properly + } + } + } + return result.length === 0; +} + +console.log(matchParenthesis("}{{}}"), matchParenthesis("{{[]}}")); // false - true +``` + +
+ + + +## Q. Create Custom Event Emitter class + +
Answer + +```javascript +class EventEmitter { + constructor() { + this.holder = {}; + } + + on(eventName, fn) { + if (eventName && typeof fn === "function") { + this.holder[eventName] = this.holder[eventName] || []; + this.holder[eventName].push(fn); + } + } + + emit(eventName, ...args) { + let eventColl = this.holder[eventName]; + if (eventColl) { + eventColl.forEach((callback) => callback(args)); + } + } +} + +let e = new EventEmitter(); +e.on("callme", function (args) { + console.log(`you called me ${args}`); +}); +e.on("callme", function (args) { + console.log(`testing`); +}); + +e.emit("callme", ["a", "b"], { firstName: "umesh", lastName: "gohil" }); +``` + +
+ + + +## Q. Move all zero\'s to end + +
Answer + +```javascript +const moveZeroToEnd = (arr) => { + for (let i = 0, j = 0; j < arr.length; j++) { + if (arr[j] !== 0) { + if (i < j) { + [arr[i], arr[j]] = [arr[j], arr[i]]; // swap i and j + } + i++; + } + } + return arr; +}; + +console.log(moveZeroToEnd([1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0])); // [1, 8, 2, 3, 4, 5, 0, 0, 0, 0, 0] +``` + +
+ + + +## Q. Decode message in matrix [diagional down right, diagional up right] + +
Answer + +```javascript +const decodeMessage = (mat) => { + // check if matrix is null or empty + if (mat == null || mat.length === 0) { + return ""; + } + let x = mat.length - 1; + let y = mat[0].length - 1; + let message = ""; + let decode = (mat, i = 0, j = 0, direction = "DOWN") => { + message += mat[i][j]; + + if (i === x) { + direction = "UP"; + } + + if (direction === "DOWN") { + i++; + } else { + i--; + } + + if (j === y) { + return; + } + + j++; + decode(mat, i, j, direction); + }; + decode(mat); + return message; +}; + +let mat = [ + ["I", "B", "C", "A", "L", "K", "A"], + ["D", "R", "F", "C", "A", "E", "A"], + ["G", "H", "O", "E", "L", "A", "D"], + ["G", "H", "O", "E", "L", "A", "D"], +]; + +console.log(decodeMessage(mat)); //IROELEA +``` + +
+ + + +## Q. find a pair in array, whose sum is equal to given number? + +
Answer + +```javascript +const hasPairSum = (arr, sum) => { + if (arr == null && arr.length < 2) { + return false; + } + + let left = 0; + let right = arr.length - 1; + let result = false; + + while (left < right && !result) { + let pairSum = arr[left] + arr[right]; + if (pairSum < sum) { + left++; + } else if (pairSum > sum) { + right--; + } else { + result = true; + } + } + return result; +}; + +console.log(hasPairSum([1, 2, 4, 5], 8)); // null +console.log(hasPairSum([1, 2, 4, 4], 8)); // [2,3] + +const hasPairSum = (arr, sum) => { + let difference = {}; + let hasPair = false; + arr.forEach((item) => { + let diff = sum - item; + if (!difference[diff]) { + difference[item] = true; + } else { + hasPair = true; + } + }); + return hasPair; +}; +console.log(hasPairSum([6, 4, 3, 8], 8)); + +// NOTE: if array is not sorted then subtract the value with sum and store in difference +// then see if that value exist in difference then return true. +``` + +
+ + + +## Q. Binary Search [Array should be sorted] + +
Answer + +```javascript +function binarySearch(arr, val) { + let startIndex = 0, + stopIndex = arr.length - 1, + middleIndex = Math.floor((startIndex + stopIndex) / 2); + + while (arr[middleIndex] !== val && startIndex < stopIndex) { + if (val < arr[middleIndex]) { + stopIndex = middleIndex - 1; + } else if (val > arr[middleIndex]) { + startIndex = middleIndex + 1; + } + middleIndex = Math.floor((startIndex + stopIndex) / 2); + } + + return arr[middleIndex] === val ? middleIndex : -1; +} + +console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 22)); +console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 27)); +``` + +
+ + + +## Q. Write a function to generate Pascal triangle? + +
Answer + +```javascript +function pascalTriangle(n) { + let last = [1], + triangle = [last]; + for (let i = 0; i < n; i++) { + const ls = [0].concat(last), //[0,1] // [0,1,1] + rs = last.concat([0]); //[1,0] // [1,1,0] + last = rs.map((r, i) => ls[i] + r); //[1, 1] // [1,2,1] + triangle = triangle.concat([last]); // [[1], [1,1]] // [1], [1, 1], [1, 2, 1] + } + return triangle; +} + +console.log(pascalTriangle(2)); +``` + +
+ + + +## Q. Remove array element based on object property? + +
Answer + +```javascript +var myArray = [ + { field: "id", operator: "eq" }, + { field: "cStatus", operator: "eq" }, + { field: "money", operator: "eq" }, +]; + +myArray = myArray.filter(function (obj) { + return obj.field !== "money"; +}); + +Console.log(myArray); +``` + +Output + +```js +myArray = [ + {field: "id", operator: "eq"} + {field: "cStatus", operator: "eq"} +] +``` + +
+ + + +## Q. Write a program to get the value of an object from a specific path? + +**Example:** + +```js +Input: + +const data = { + user: { + username: 'Navin Chauhan', + password: 'Secret' + }, + rapot: { + title: 'Storage usage raport', + goal: 'Remove unused data.' + } +}; + +Output: +console.log(getObjectProperty(data, 'user.username')); // Navin Chauhan +``` + +
Answer + +```js +const getObjectProperty = (object, path) => { + const parts = path.split('.'); + + for (let i = 0; i < parts.length; ++i) { + const key = parts[i]; + object = object[key]; + } + return object; +}; +``` + +
+ + + +## Q. Find the unique number in given array? + +**Example:** + +```js +Input: [1, 1, 3, 2, 3] +Output: 2 +``` + +
Answer + +```js +const arr = [1, 1, 3, 2, 3]; +const count = {}; + +for (const element of arr) { + if (count[element]) { + count[element] += 1; + } else { + count[element] = 1; + } +} + +console.log(count); // {1: 2, 2: 1, 3: 2} +``` + +
+ + + +## Q. Improve the below function? + +```js +var yourself = { + fibonacci: function (n) { + if (n === 0) { + return 0; + } else if (n === 1) { + return 1; + } else { + return this.fibonacci(n - 1) + this.fibonacci(n - 2); + } + }, +}; + +console.log(yourself.fibonacci(2)); // 1 +console.log(yourself.fibonacci(10)); // 55 +``` + +
Answer + +```js +var yourself = { + fibonacci: function (n) { + let arr = [0, 1]; + for (let i = 2; i < n + 1; i++) { + arr.push(arr[i - 2] + arr[i - 1]); + } + return arr[n]; + }, +}; +``` + +
+ + + +## Q. Write a program that prints the numbers from 1 to 15. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”? + +**Example:** + +```js +Input: 15 +Output: +1 +2 +Fizz +4 +Buzz +Fizz +7 +8 +Fizz +Buzz +11 +Fizz +13 +14 +FizzBuzz +``` + +
Answer + +**Solution - 01:** + +```javascript +for (var i = 1; i <= 15; i++) { + if (i % 15 == 0) console.log("FizzBuzz"); + else if (i % 3 == 0) console.log("Fizz"); + else if (i % 5 == 0) console.log("Buzz"); + else console.log(i); +} +``` + +**Solution - 02:** + +```javascript +for (var i = 1; i <= 15; i++) { + var f = i % 3 == 0, + b = i % 5 == 0; + console.log(f ? (b ? "FizzBuzz" : "Fizz") : b ? "Buzz" : i); +} +``` + +
+ + From 15ba85197107bb5778a12b83394d99eaae8ad3b4 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 6 Nov 2022 08:45:23 +0530 Subject: [PATCH 055/117] Update README.md --- README.md | 2234 +---------------------------------------------------- 1 file changed, 3 insertions(+), 2231 deletions(-) diff --git a/README.md b/README.md index 504ce99..0773b97 100644 --- a/README.md +++ b/README.md @@ -4,2186 +4,11 @@
-## Q. Write a function to accept argument like `sum(num1)(num2);` or `sum(num1,num2);` +## Related Interview Questions -**Example 1:** +* [JavaScript Program Writing Questions](program-writing) -```js -Input: sum(10)(20); -Output: 30 -Explanation: 10 + 20 = 30 -``` - -**Example 2:** - -```js -Input: sum(10, 20); -Output: 30 -Explanation: 10 + 20 = 30 -``` - -
Answer - -```javascript -function sum(x, y) { - if (y !== undefined) { - return x + y; - } else { - return function (y) { - return x + y; - }; - } -} - -console.log(sum(10, 20)); -console.log(sum(10)(20)); -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-1-ypmjhl?file=/src/index.js)** - -
- - - -## Q. Write a function to get the difference between two arrays? - -**Example:** - -```js -Input: -var a1 = ['a', 'b']; -var a2 = ['a', 'b', 'c', 'd']; - -Output: -["c", "d"] -``` - -
Answer - -```js -let arr1 = ['a', 'b']; -let arr2 = ['a', 'b', 'c', 'd']; - -let difference = arr2.filter(x => !arr1.includes(x)); -``` - -
- - - -## Q. Write a function to accept argument like `[array1].diff([array2]);` - -**Example:** - -```js -Input: [1, 2, 3, 4, 5, 6].diff([3, 4, 5]); -Output: [1, 2, 6]; -``` - -
Answer - -```js -Array.prototype.diff = function (a) { - return this.filter(function (i) { - return a.indexOf(i) < 0; - }); -}; - -const dif1 = [1, 2, 3, 4, 5, 6].diff([3, 4, 5]); -console.log(dif1); // => [1, 2, 6] -``` - -
- - - -## Q. Validate file size and extension before file upload in JavaScript? - -
Answer - -```html - - - - JavaScript File Upload Example - - - - -
- - -
- - - - - -File Name: pic.jpg -File Size: 1159168 bytes -File Extension: jpg -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-file-upload-fj17kh?file=/index.html)** - -
- - - -## Q. Create a captcha using javascript? - -
Answer - -```html - - - - JavaScript Captcha Example - - - - -

- - - -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-captcha-mzyi2n?file=/index.html)** - -
- - - -## Q. Create a stopwatch in javascript? - -
Answer - -```html - - - - Stopwatch Example - - - -

Time: 00:00:00



- - - - - - - -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-stopwatch-j6in1i?file=/index.html)** - -

- - - -## Q. Write a program to reverse a string? - -
Answer - -```javascript -function reverseString(str) { - let stringRev = ""; - for (let i = str.length; i >= 0; i--) { - stringRev = stringRev + str.charAt(i); - } - return stringRev; -} -console.log(reverseString("Hello")); -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-reversestring-sgm1ip?file=/src/index.js)** - -
- - - -## Q. Create a Promise to accept car names as argument and send response once the argument matches with Maruti? - -
Answer - -```js -async function myCars(name) { - const promise = new Promise((resolve, reject) => { - name === "Maruti" ? resolve(name) : reject(name); - }); - - const result = await promise; - console.log(result); // "resolved!" -} - -myCars("Maruti"); -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-promise-1tmrnp?file=/src/index.js)** - -
- - - -## Q. Write a function to merge two JavaScript Object dynamically? - -**Example:** - -```js -Input: - -const person = { - name: "Tanvi", - age: 28 -}; - -const address = { - addressLine1: "Some Location x", - addressLine2: "Some Location y", - city: "Bangalore" -}; - -Output: - -// Now person should have 5 properties -name, age, addressLine1, addressLine2, city -``` - -
Answer - -Write merge function which will take two object and add all the own property of second object into first object. - -**Method 1: Using ES6, Object.assign method:** - -```js -const merge = (toObj, fromObj) => Object.assign(toObj, fromObj); - -console.log(merge(person, address)); -// {name: "Tanvi", age: 28, addressLine1: "Some Location x", addressLine2: "Some Location y", city: "Bangalore"} -``` - -**Method 2: Without using built-in function:** - -```js -function mergeObject(toObj, fromObj) { - // Make sure both of the parameter is an object - if (typeof toObj === "object" && typeof fromObj === "object") { - for (var pro in fromObj) { - // Assign only own properties not inherited properties - if (fromObj.hasOwnProperty(pro)) { - toObj[pro] = fromObj[pro]; - } - } - } else { - throw "Merge function can apply only on object"; - } -} - -console.log(mergeObject(person, address)); -// {name: "Tanvi", age: 28, addressLine1: "Some Location x", addressLine2: "Some Location y", city: "Bangalore"} -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-shallow-vs-deep-copy-ik5b7h?file=/src/index.js)** - -
- - - -## Q. Being told that an unsorted array contains (n - 1) of n consecutive numbers (where the bounds are defined), find the missing number in O(n) time? - -**Example:** - -```js -Input: -array = [2, 5, 1, 4, 9, 6, 3, 7]; -upperBound = 9; -lowerBound = 1; - -Output: -8 -``` - -
Answer - -```js -/** - * Find theoretical sum of the consecutive numbers using a variation of Gauss Sum. - * Formula: [(Max * (Max + 1)) / 2] - [(Min * (Min - 1)) / 2]; - * Max is the upper bound and Min is the lower bound - */ -function findMissingNumber(arrayOfIntegers, upperBound, lowerBound) { - - var sumOfIntegers = 0; - for (var i = 0; i < arrayOfIntegers.length; i++) { - sumOfIntegers += arrayOfIntegers[i]; - } - - upperLimitSum = (upperBound * (upperBound + 1)) / 2; - lowerLimitSum = (lowerBound * (lowerBound - 1)) / 2; - - theoreticalSum = upperLimitSum - lowerLimitSum; - - return theoreticalSum - sumOfIntegers; -} -``` - -
- - - -## Q. Write a function to remove duplicates from an array in JavaScript? - -
Answer - -**1. Using set():** - -```javascript -const names = ['John', 'Paul', 'George', 'Ringo', 'John']; - -let unique = [...new Set(names)]; -console.log(unique); // 'John', 'Paul', 'George', 'Ringo' -``` - -**2. Using filter():** - -```javascript -const names = ['John', 'Paul', 'George', 'Ringo', 'John']; - -let x = (names) => names.filter((v,i) => names.indexOf(v) === i) -x(names); // 'John', 'Paul', 'George', 'Ringo' -``` - -**3. Using forEach():** - -```javascript -const names = ['John', 'Paul', 'George', 'Ringo', 'John']; - -function removeDups(names) { - let unique = {}; - names.forEach(function(i) { - if(!unique[i]) { - unique[i] = true; - } - }); - return Object.keys(unique); -} - -removeDups(names); // // 'John', 'Paul', 'George', 'Ringo' -``` - -
- - - -## Q. Given a string, reverse each word in the sentence - -**Example:** - -```js -Input: "Hello World"; -Output: "olleH dlroW"; -``` - -
Answer - -```js -const str = "Hello World"; - -let reverseEntireSentence = reverseBySeparator(str, ""); - -console.log(reverseBySeparator(reverseEntireSentence, " ")); - -function reverseBySeparator(string, separator) { - return string.split(separator).reverse().join(separator); -} -``` - -
- - - -## Q. Implement enqueue and dequeue using only two stacks - -Enqueue means to add an element, dequeue to remove an element. - -
Answer - -```js -var inputStack = []; // First stack -var outputStack = []; // Second stack - -// For enqueue, just push the item into the first stack -function enqueue(stackInput, item) { - return stackInput.push(item); -} - -function dequeue(stackInput, stackOutput) { - // Reverse the stack such that the first element of the output stack is the - // last element of the input stack. After that, pop the top of the output to - // get the first element that was ever pushed into the input stack - if (stackOutput.length <= 0) { - while(stackInput.length > 0) { - var elementToOutput = stackInput.pop(); - stackOutput.push(elementToOutput); - } - } - - return stackOutput.pop(); -} -``` - -
- - - -## Q. Use a closure to create a private counter? - -**Example:** - -You can create a function within an outer function (a closure) that allows you to update a private variable but the variable wouldn\'t be accessible from outside the function without the use of a helper function. - -
Answer - -```js -function counter() { - var _counter = 0; - // return an object with several functions that allow you - // to modify the private _counter variable - return { - add: function (increment) { - _counter += increment; - }, - retrieve: function () { - return "The counter is currently at: " + _counter; - }, - }; -} - -// error if we try to access the private variable like below -// _counter; - -// usage of our counter function -var c = counter(); -c.add(5); -c.add(9); - -// now we can access the private variable in the following way -c.retrieve(); // => The counter is currently at: 14 -``` - -
- - - -## Q. Write a function to divide an array into multiple equal parts? - -**Example:** - -```js -Input: [10, 20, 30, 40, 50]; -Length: 3 -Output: -[10, 20, 30] -[40, 50] -``` - -
Answer - -```js -const arr = [10, 20, 30, 40, 50]; -let lenth = 3; - -function split(len) { - while (arr.length > 0) { - console.log(arr.splice(0, len)); - } -} -split(lenth); -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/split-array-5od3rz)** - -
- - - -## Q. Write a random integers function to print integers with in a range? - -**Example:** - -```js -Input: 1, 100 -Output: 63 -``` - -
Answer - -```js -/** - * function to return a random number - * between min and max range - */ -function randomInteger(min, max) { - return Math.floor(Math.random() * (max - min + 1) ) + min; -} - -randomInteger(1, 100); // returns a random integer from 1 to 100 -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-random-integers-yd1cy8?file=/src/index.js)** - -
- - - -## Q. Write a function to convert decimal number to binary number? - -**Example 01:** - -```js -Input: 10 -Output: 1010 -``` - -**Example 02:** - -```js -Input: 7 -Output: 111 -``` - -
Answer - -```js -function DecimalToBinary(number) { - let bin = 0; - let rem, - i = 1; - while (number !== 0) { - rem = number % 2; - number = parseInt(number / 2); - bin = bin + rem * i; - i = i * 10; - } - console.log(`Binary: ${bin}`); -} - -DecimalToBinary(10); -``` - -**Example 02:** Convert Decimal to Binary Using `toString()` - -```js -let val = 10; - -console.log(val.toString(2)); // 1010 ==> Binary Conversion -console.log(val.toString(8)); // 12 ==> Octal Conversion -console.log(val.toString(16)); // A ==> Hexadecimal Conversion -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-decimal-to-binary-uhyi8t?file=/src/index.js)** - -
- - - -## Q. Write a function make first letter of the string in an uppercase? - -**Example:** - -```js -Input: hello world -Output: Hello World -``` - -
Answer - -You can create a function which uses chain of string methods such as charAt, toUpperCase and slice methods to generate a string with first letter in uppercase. - -```js -function capitalizeFirstLetter(string) { - let arr = string.split(" "); - for (var i = 0; i < arr.length; i++) { - arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1); - } - return arr.join(" "); -} - -console.log(capitalizeFirstLetter("hello world")); // Hello World -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-capitalizefirstletter-dpjhky?file=/src/index.js)** - -
- - - -## Q. Write a function which will test string as a literal and as an object? - -**Example 01:** - -```js -Input: const ltrlStr = "Hi I am string literal"; -Output: It is a string literal -``` - -**Example 02:** - -```js -Input: const objStr = new String("Hi I am string object"); -Output: It is an object of string -``` - -
Answer - -The `typeof` operator can be use to test string literal and `instanceof` operator to test String object. - -```js -function check(str) { - if (str instanceof String) { - return "It is an object of string"; - } else { - if (typeof str === "string") { - return "It is a string literal"; - } else { - return "another type"; - } - } -} - -var ltrlStr = "Hi I am string literal"; -var objStr = new String("Hi I am string object"); - -console.log(check(ltrlStr)); // It is a string literal -console.log(check(objStr)); // It is an object of string -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-literal-vs-object-978dqw?file=/src/index.js)** - -
- - - -## Q. How do you reversing an array? - -
Answer - -You can use reverse() method is used reverse the elements in an array. This method is useful to sort an array in descending order. Let us see the usage of reverse() method in an example, - -```js -const fruits = ["Apple", "Banana", "Mango", "Orange"]; - -const reversed = fruits.reverse(); -console.log('reversed:', reversed); -// expected output: "reversed:" Array ["Orange", "Mango", "Banana", "Apple"] -``` - -
- - - -## Q. How do you find min and max value in an array? - -**Example:** - -```js -Input: [50, 20, 70, 60, 45, 30]; -Output: -Min: 20 -Max: 70 -``` - -
Answer - -You can use `Math.min` and `Math.max` methods on array variable to find the minimum and maximum elements with in an array. -Let us create two functions to find the min and max value with in an array, - -```js -var marks = [50, 20, 70, 60, 45, 30]; - -function findMin(arr) { - return Math.min.apply(null, arr); -} -function findMax(arr) { - return Math.max.apply(null, arr); -} - -console.log(findMin(marks)); -console.log(findMax(marks)); -``` - -
- - - -## Q. How do you find min and max values without Math functions? - -
Answer - -You can write functions which loops through an array comparing each value with the lowest value or highest value to find the min and max values. Let us create those functions to find min an max values, - -```js -var marks = [50, 20, 70, 60, 45, 30]; - -function findMin(arr) { - var length = arr.length; - var min = Infinity; - while (length--) { - if (arr[length] < min) { - min = arr[length]; - } - } - return min; -} - -function findMax(arr) { - var length = arr.length; - var max = -Infinity; - while (length--) { - if (arr[length] > max) { - max = arr[length]; - } - } - return max; -} - -console.log(findMin(marks)); -console.log(findMax(marks)); -``` - -
- - - -## Q. Check if object is empty or not using javaScript? - -
Answer - -```javascript -function isEmpty(obj) { - return Object.keys(obj).length === 0; -} - -const obj = {}; -console.log(isEmpty(obj)); -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-isempty-b7n04b?file=/src/index.js)** - -
- - - -## Q. Write a function to validate an email using regular expression? - -
Answer - -```javascript -function validateEmail(email) { - const re = /\S+@\S+\.\S+/; - return re.test(email); -} - -console.log(validateEmail("pradeep.vwa@gmail.com")); // true -``` - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-validateemail-wfopym?file=/src/index.js)** - -
- - - -## Q. Use RegEx to test password strength in JavaScript? - -
Answer - -```javascript -let newPassword = "Pq5*@a{J"; -const regularExpression = new RegExp( - "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#$%^&*])(?=.{8,})" -); - -if (!regularExpression.test(newPassword)) { - alert("Password should contain atleast one number and one special character !"); -} else { - console.log("PASS"); -} - -// Output -PASS -``` - -| RegEx | Description | -| ---------------- |--------------| -| ^ | The password string will start this way | -| (?=.\*[a-z]) | The string must contain at least 1 lowercase alphabetical character | -| (?=.\*[A-Z]) | The string must contain at least 1 uppercase alphabetical character | -| (?=.\*[0-9]) | The string must contain at least 1 numeric character | -| (?=.[!@#\$%\^&]) | The string must contain at least one special character, but we are escaping reserved RegEx characters to avoid conflict | -| (?=.{8,}) | The string must be eight characters or longer | - -**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-password-strength-cxl8xy)** - -
- - - -## Q. Write a script that returns the number of occurrences of character given a string as input - -
Answer - -```javascript -function countCharacters(str) { - return str.replace(/ /g, "").toLowerCase().split("").reduce((p, c) => { - if (c in p) { - p[c]++; - } else { - p[c] = 1; - } - return p; - }, {}); -} -console.log(countCharacters("the brown fox jumps over the lazy dog")); -``` - -
- - - -## Q. Write a function that return the number of occurrences of a character in paragraph? - -
Answer - -```javascript -function charCount(str, searchChar) { - let count = 0; - if (str) { - let stripStr = str.replace(/ /g, "").toLowerCase(); //remove spaces and covert to lowercase - for (let chr of stripStr) { - if (chr === searchChar) { - count++; - } - } - } - return count; -} -console.log(charCount("the brown fox jumps over the lazy dog", "o")); -``` - -
- - - -## Q. Write a recursive and non-recursive Factorial function? - -
Answer - -```javascript -function recursiveFactorial(n) { - if (n < 1) { - throw Error("Value of N has to be greater then 1"); - } - if (n === 1) { - return 1; - } else { - return n * recursiveFactorial(n - 1); - } -} - -console.log(recursiveFactorial(5)); - -function factorial(n) { - if (n < 1) { - throw Error("Value of N has to be greater then 1"); - } - if (n === 1) { - return 1; - } - let result = 1; - for (let i = 1; i <= n; i++) { - result = result * i; - } - return result; -} - -console.log(factorial(5)); -``` - -
- - - -## Q. Write a recursive and non recursive fibonacci-sequence? - -
Answer - -```javascript -// 1, 1, 2, 3, 5, 8, 13, 21, 34 - -function recursiveFibonacci(num) { - if (num <= 1) { - return 1; - } else { - return recursiveFibonacci(num - 1) + recursiveFibonacci(num - 2); - } -} - -console.log(recursiveFibonacci(8)); - -function fibonnaci(num) { - let a = 1, - b = 0, - temp; - while (num >= 0) { - temp = a; - a = a + b; - b = temp; - num--; - } - return b; -} - -console.log(fibonnaci(7)); - -// Memoization fibonnaci - -function fibonnaci(num, memo = {}) { - if (num in memo) { - return memo[num]; - } - if (num <= 1) { - return 1; - } - return (memo[num] = fibonnaci(num - 1, memo) + fibonnaci(num - 2, memo)); -} - -console.log(fibonnaci(5)); // 8 -``` - -
- - - -## Q. Generate a random Number between min and max? - -
Answer - -```javascript -// 5 to 7 -let min = 5; -let max = 7; -console.log(min + Math.floor(Math.random() * (max - min + 1))); -``` - -
- - - -## Q. Write a function to reverse the number? - -
Answer - -```javascript -function reverse(num) { - let result = 0; - while (num != 0) { - result = result * 10; - result = result + (num % 10); - num = Math.floor(num / 10); - } - return result; -} - -console.log(reverse(12345)); -``` - -
- - - -## Q. How to perform deep copy of object or clone of object? - -
Answer - -```javascript -function deepExtend(out = {}) { - for (let i = 1; i < arguments.length; i++) { - let obj = arguments[i]; - if (obj == null) - // skip undefined and null [check with double equal not triple] - continue; - - obj = Object(obj); - - for (let key in obj) { - // avoid shadow hasownproperty of parent - if (Object.prototype.hasOwnProperty.call(obj, key)) { - if ( - typeof obj[key] === "object" && - !Array.isArray(obj[key]) && - obj[key] != null - ) - out[key] = deepExtend(out[key], obj[key]); - else out[key] = obj[key]; - } - } - } - return out; -} - -//Alternative if there are no function -let cloneObj = JSON.parse(JSON.stringify(obj)); - -console.log(deepExtend({}, { a: 1, b: { c: 2, d: 3 } }, { e: 4, b: { f: 1 } })); -//output : { a: 1, b: {c: 2, d: 3, f: 1}, e: 4 } -``` - -
- - - -## Q. Write a function to reverse an array? - -
Answer - -```javascript -let a = [10, 20, 30, 40, 50]; - -//Approach 1: -console.log(a.reverse()); - -//Approach 2: -let reverse = a.reduce((prev, current) => { - prev.unshift(current); - return prev; -}, []); - -console.log(reverse); -``` - -
- - - -## Q. Rotate 2D array - -**Example:** - -```js -Input: -[1, 2, 3, 4], -[5, 6, 7, 8], -[9, 10, 11, 12] - - -Output: -[1, 5, 9] -[2, 6, 10] -[3, 7, 11] -[4, 8, 12] -``` - -
Answer - -```javascript -const transpose = (arr) => arr[0].map((col, i) => arr.map((row) => row[i])); - -console.log( - transpose([ - [1, 2, 3, 4], - [5, 6, 7, 8], - [9, 10, 11, 12], - ]) -); -``` - -
- - - -## Q. Get Column from 2D Array - -
Answer - -```javascript -const getColumn = (arr, n) => arr.map((x) => x[n]); - -const twoDimensionalArray = [ - [1, 2, 3], - [4, 5, 6], - [7, 8, 9], -]; - -console.log(getColumn(twoDimensionalArray, 1)); //Result = [2,5,8] -``` - -
- - - -## Q. Get top N from array - -
Answer - -```javascript -function topN(arr, num) { - let sorted = arr.sort((a, b) => a - b); - return sorted.slice(sorted.length - num, sorted.length); -} - -console.log(topN([1, 8, 3, 4, 5], 2)); // [5,8] -``` - -
- - - -## Q. Get query params from Object - -
Answer - -```javascript -function getQueryParams(obj) { - let parms = ""; - for (let key in obj) { - if (obj.hasOwnProperty(key)) { - if (parms.length > 0) { - parms += "&"; - } - parms += encodeURI(`${key}=${obj[key]}`); - } - } - return parms; -} - -console.log( - getQueryParams({ - name: "Umesh", - tel: "48289", - add: "3333 emearld st", - }) -); -``` - -
- - - -## Q. Consecutive 1\'s in binary - -
Answer - -```javascript -function consecutiveOne(num) { - let binaryArray = num.toString(2); - - let maxOccurence = 0, - occurence = 0; - for (let val of binaryArray) { - if (val === "1") { - occurence += 1; - maxOccurence = Math.max(maxOccurence, occurence); - } else { - occurence = 0; - } - } - return maxOccurence; -} -//13 = 1101 = 2 -//5 = 101 = 1 -console.log(consecutiveOne(5)); //1 -``` - -
- - - -## Q. Spiral travesal of matrix - -
Answer - -```javascript -var input = [ - [1, 2, 3, 4], - [5, 6, 7, 8], - [9, 10, 11, 12], - [13, 14, 15, 16], -]; - -var spiralTraversal = function (matriks) { - let result = []; - var goAround = function (matrix) { - if (matrix.length === 0) { - return; - } - - // right - result = result.concat(matrix.shift()); - - // down - for (var j = 0; j < matrix.length - 1; j++) { - result.push(matrix[j].pop()); - } - - // bottom - result = result.concat(matrix.pop().reverse()); - - // up - for (var k = matrix.length - 1; k > 0; k--) { - result.push(matrix[k].shift()); - } - - return goAround(matrix); - }; - - goAround(matriks); - - return result; -}; -console.log(spiralTraversal(input)); // [1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10] -``` - -
- - - -## Q. Merge Sorted array and sort it. - -
Answer - -```javascript -function mergeSortedArray(arr1, arr2) { - return [...new Set(arr1.concat(arr2))].sort((a, b) => a - b); -} - -console.log(mergeSortedArray([1, 2, 3, 4, 5, 6], [0, 3, 4, 7])); // [0, 1, 2, 3, 4, 5, 6, 7] -``` - -
- - - -## Q. Anagram of words - -
Answer - -```javascript -const alphabetize = (word) => word.split("").sort().join(""); - -function groupAnagram(wordsArr) { - return wordsArr.reduce((p, c) => { - const sortedWord = alphabetize(c); - if (sortedWord in p) { - p[sortedWord].push(c); - } else { - p[sortedWord] = [c]; - } - return p; - }, {}); -} - -console.log( - groupAnagram(["map", "art", "how", "rat", "tar", "who", "pam", "shoop"]) -); -// result : { -// amp: ["map", "pam"], -// art: ["art", "rat", "tar"], -// hoops: ["shoop"], -// how: ["how", "who"] -// } -``` - -
- - - -## Q. Print the largest (maximum) hourglass sum found in 2d array. - -
Answer - -```javascript -// if arr 6 X 6 then iterate it till 4 X 4 [reduce by two] -// if arr 8 X 8 then iterate it till 6 X 6 [reduce by two] -function main(arr) { - let maxScore = -999; - let len = arr.length; - for (let i = 0; i < len - 2; i++) { - for (let j = 0; j < len - 2; j++) { - let total = - arr[i][j] + - arr[i][j + 1] + - arr[i][j + 2] + - arr[i + 1][j + 1] + - arr[i + 2][j] + - arr[i + 2][j + 1] + - arr[i + 2][j + 2]; - - maxScore = Math.max(maxScore, total); - } - } - console.log(maxScore); -} -``` - -
- - - -## Q. Transform array of object to array - -
Answer - -```javascript -let data = [ - { vid: "aaa", san: 12 }, - { vid: "aaa", san: 18 }, - { vid: "aaa", san: 2 }, - { vid: "bbb", san: 33 }, - { vid: "bbb", san: 44 }, - { vid: "aaa", san: 100 }, -]; - -let newData = data.reduce((acc, item) => { - acc[item.vid] = acc[item.vid] || { vid: item.vid, san: [] }; - acc[item.vid]["san"].push(item.san); - return acc; -}, {}); - -console.log(Object.keys(newData).map((key) => newData[key])); - -// Result -// [[object Object] { -// san: [12, 18, 2, 100], -// vid: "aaa" -// }, [object Object] { -// san: [33, 44], -// vid: "bbb" -// }] -``` - -
- - - -## Q. Create a private variable or private method in object - -
Answer - -```javascript -let obj = (function () { - function getPrivateFunction() { - console.log("this is private function"); - } - let p = "You are accessing private variable"; - return { - getPrivateProperty: () => { - console.log(p); - }, - callPrivateFunction: getPrivateFunction, - }; -})(); - -obj.getPrivateValue(); // You are accessing private variable -console.log("p" in obj); // false -obj.callPrivateFunction(); // this is private function -``` - -
- - - -## Q. Flatten only Array not objects - -
Answer - -```javascript -function flatten(arr, result = []) { - arr.forEach((val) => { - if (Array.isArray(val)) { - flatten(val, result); - } else { - result.push(val); - } - }); - return result; -} - -let input = [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; -console.log(flatten(input)); // [1, { a: [2, [3]]}, 4, 5, 6, 7, "hi", 8, 9, 10] - -function flattenIterative(out) { - // iteratively - let result = out; - while (result.some(Array.isArray)) { - result = [].concat.apply([], result); - } - return result; -} -var list1 = [ - [0, 1], - [2, 3], - [4, 5], -]; -console.log(flattenIterative(list1)); // [0, 1, 2, 3, 4, 5] - -function flattenIterative1(current) { - let result = []; - while (current.length) { - let firstValue = current.shift(); - if (Array.isArray(firstValue)) { - current = firstValue.concat(current); - } else { - result.push(firstValue); - } - } - return result; -} - -let input = [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; -console.log(flattenIterative1(input)); -var list2 = [0, [1, [2, [3, [4, [5]]]]]]; -console.log(flattenIterative1(list2)); // [0, 1, 2, 3, 4, 5] -``` - -
- - - -## Q. Find max difference between two number in Array - -
Answer - -```javascript -function maxDifference(arr) { - let maxDiff = 0; - - for (let i = 0; i < arr.length; i++) { - for (let j = i + 1; j < arr.length; j++) { - let diff = Math.abs(arr[i] - arr[j]); - maxDiff = Math.max(maxDiff, diff); - } - } - return maxDiff; -} - -console.log(maxDifference([1, 2, 4])); // [1 - 4 ] = 3 -``` - -
- - - -## Q. swap two number in ES6 [destructing] - -
Answer - -```javascript -let a = 10, b = 5; - -[a, b] = [b, a]; -``` - -
- - - -## Q. Panagram ? it means all the 26 letters of alphabet are there - -
Answer - -```javascript -function panagram(input) { - if (input == null) { - // Check for null and undefined - return false; - } - - if (input.length < 26) { - // if length is less then 26 then it is not - return false; - } - input = input.replace(/ /g, "").toLowerCase().split(""); - let obj = input.reduce((prev, current) => { - if (!(current in prev)) { - prev[current] = current; - } - return prev; - }, {}); - console.log(Object.keys(obj).length === 26 ? "panagram" : "not pangram"); -} -processData("We promptly judged antique ivory buckles for the next prize"); // pangram -processData("We promptly judged antique ivory buckles for the prize"); // Not Pangram -``` - -
- - - -## Q. Given two identical DOM trees (not the same one), and a node from one of them find the node in the other one. - -
Answer - -```javascript -function indexOf(arrLike, target) { - return Array.prototype.indexOf.call(arrLike, target); -} - -// Given a node and a tree, extract the nodes path -function getPath(root, target) { - var current = target; - var path = []; - while (current !== root) { - let parentNode = current.parentNode; - path.unshift(indexOf(parentNode.childNodes, current)); - current = parentNode; - } - return path; -} - -// Given a tree and a path, let\'s locate a node -function locateNodeFromPath(node, path) { - return path.reduce((root, index) => root.childNodes[index], node); -} - -const rootA = document.querySelector("#root-a"); -const rootB = document.querySelector("#root-b"); -const target = rootA.querySelector(".person__age"); - -console.log(locateNodeFromPath(rootB, getPath(rootA, target))); -``` - -
- - - -## Q. Convert a number into a Roman Numeral - -
Answer - -```javascript -function romanize(num) { - let lookup = { - M: 1000, - CM: 900, - D: 500, - CD: 400, - C: 100, - XC: 90, - L: 50, - XL: 40, - X: 10, - IX: 9, - V: 5, - IV: 4, - I: 1, - }, - roman = ""; - for (let i in lookup) { - while (num >= lookup[i]) { - roman += i; - num -= lookup[i]; - } - } - return roman; -} - -console.log(romanize(3)); // III -``` - -
- - - -## Q. check if parenthesis is malformed or not - -
Answer - -```javascript -function matchParenthesis(str) { - let obj = { "{": "}", "(": ")", "[": "]" }; - let result = []; - for (let s of str) { - if (s === "{" || s === "(" || s === "[") { - // All opening brackets - result.push(s); - } else { - if (result.length > 0) { - let lastValue = result.pop(); //pop the last value and compare with key - if (obj[lastValue] !== s) { - // if it is not same then it is not formated properly - return false; - } - } else { - return false; // empty array, there is nothing to pop. so it is not formated properly - } - } - } - return result.length === 0; -} - -console.log(matchParenthesis("}{{}}"), matchParenthesis("{{[]}}")); // false - true -``` - -
- - - -## Q. Create Custom Event Emitter class - -
Answer - -```javascript -class EventEmitter { - constructor() { - this.holder = {}; - } - - on(eventName, fn) { - if (eventName && typeof fn === "function") { - this.holder[eventName] = this.holder[eventName] || []; - this.holder[eventName].push(fn); - } - } - - emit(eventName, ...args) { - let eventColl = this.holder[eventName]; - if (eventColl) { - eventColl.forEach((callback) => callback(args)); - } - } -} - -let e = new EventEmitter(); -e.on("callme", function (args) { - console.log(`you called me ${args}`); -}); -e.on("callme", function (args) { - console.log(`testing`); -}); - -e.emit("callme", ["a", "b"], { firstName: "umesh", lastName: "gohil" }); -``` - -
- - - -## Q. Move all zero\'s to end - -
Answer - -```javascript -const moveZeroToEnd = (arr) => { - for (let i = 0, j = 0; j < arr.length; j++) { - if (arr[j] !== 0) { - if (i < j) { - [arr[i], arr[j]] = [arr[j], arr[i]]; // swap i and j - } - i++; - } - } - return arr; -}; - -console.log(moveZeroToEnd([1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0])); // [1, 8, 2, 3, 4, 5, 0, 0, 0, 0, 0] -``` - -
- - - -## Q. Decode message in matrix [diagional down right, diagional up right] - -
Answer - -```javascript -const decodeMessage = (mat) => { - // check if matrix is null or empty - if (mat == null || mat.length === 0) { - return ""; - } - let x = mat.length - 1; - let y = mat[0].length - 1; - let message = ""; - let decode = (mat, i = 0, j = 0, direction = "DOWN") => { - message += mat[i][j]; - - if (i === x) { - direction = "UP"; - } - - if (direction === "DOWN") { - i++; - } else { - i--; - } - - if (j === y) { - return; - } - - j++; - decode(mat, i, j, direction); - }; - decode(mat); - return message; -}; - -let mat = [ - ["I", "B", "C", "A", "L", "K", "A"], - ["D", "R", "F", "C", "A", "E", "A"], - ["G", "H", "O", "E", "L", "A", "D"], - ["G", "H", "O", "E", "L", "A", "D"], -]; - -console.log(decodeMessage(mat)); //IROELEA -``` - -
- - - -## Q. find a pair in array, whose sum is equal to given number? - -
Answer - -```javascript -const hasPairSum = (arr, sum) => { - if (arr == null && arr.length < 2) { - return false; - } - - let left = 0; - let right = arr.length - 1; - let result = false; - - while (left < right && !result) { - let pairSum = arr[left] + arr[right]; - if (pairSum < sum) { - left++; - } else if (pairSum > sum) { - right--; - } else { - result = true; - } - } - return result; -}; - -console.log(hasPairSum([1, 2, 4, 5], 8)); // null -console.log(hasPairSum([1, 2, 4, 4], 8)); // [2,3] - -const hasPairSum = (arr, sum) => { - let difference = {}; - let hasPair = false; - arr.forEach((item) => { - let diff = sum - item; - if (!difference[diff]) { - difference[item] = true; - } else { - hasPair = true; - } - }); - return hasPair; -}; -console.log(hasPairSum([6, 4, 3, 8], 8)); - -// NOTE: if array is not sorted then subtract the value with sum and store in difference -// then see if that value exist in difference then return true. -``` - -
- - - -## Q. Binary Search [Array should be sorted] - -
Answer - -```javascript -function binarySearch(arr, val) { - let startIndex = 0, - stopIndex = arr.length - 1, - middleIndex = Math.floor((startIndex + stopIndex) / 2); - - while (arr[middleIndex] !== val && startIndex < stopIndex) { - if (val < arr[middleIndex]) { - stopIndex = middleIndex - 1; - } else if (val > arr[middleIndex]) { - startIndex = middleIndex + 1; - } - middleIndex = Math.floor((startIndex + stopIndex) / 2); - } - - return arr[middleIndex] === val ? middleIndex : -1; -} - -console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 22)); -console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 27)); -``` - -
- - - -## Q. Write a function to generate Pascal triangle? - -
Answer - -```javascript -function pascalTriangle(n) { - let last = [1], - triangle = [last]; - for (let i = 0; i < n; i++) { - const ls = [0].concat(last), //[0,1] // [0,1,1] - rs = last.concat([0]); //[1,0] // [1,1,0] - last = rs.map((r, i) => ls[i] + r); //[1, 1] // [1,2,1] - triangle = triangle.concat([last]); // [[1], [1,1]] // [1], [1, 1], [1, 2, 1] - } - return triangle; -} - -console.log(pascalTriangle(2)); -``` - -
- - - -## Q. Remove array element based on object property? - -
Answer - -```javascript -var myArray = [ - { field: "id", operator: "eq" }, - { field: "cStatus", operator: "eq" }, - { field: "money", operator: "eq" }, -]; - -myArray = myArray.filter(function (obj) { - return obj.field !== "money"; -}); - -Console.log(myArray); -``` - -Output - -```js -myArray = [ - {field: "id", operator: "eq"} - {field: "cStatus", operator: "eq"} -] -``` - -
- - - -## Q. Write a program to get the value of an object from a specific path? - -**Example:** - -```js -Input: - -const data = { - user: { - username: 'Navin Chauhan', - password: 'Secret' - }, - rapot: { - title: 'Storage usage raport', - goal: 'Remove unused data.' - } -}; - -Output: -console.log(getObjectProperty(data, 'user.username')); // Navin Chauhan -``` - -
Answer - -```js -const getObjectProperty = (object, path) => { - const parts = path.split('.'); - - for (let i = 0; i < parts.length; ++i) { - const key = parts[i]; - object = object[key]; - } - return object; -}; -``` - -
- - - -## Q. Find the unique number in given array? - -**Example:** - -```js -Input: [1, 1, 3, 2, 3] -Output: 2 -``` - -
Answer - -```js -const arr = [1, 1, 3, 2, 3]; -const count = {}; - -for (const element of arr) { - if (count[element]) { - count[element] += 1; - } else { - count[element] = 1; - } -} - -console.log(count); // {1: 2, 2: 1, 3: 2} -``` - -
- - - -## Q. Improve the below function? - -```js -var yourself = { - fibonacci: function (n) { - if (n === 0) { - return 0; - } else if (n === 1) { - return 1; - } else { - return this.fibonacci(n - 1) + this.fibonacci(n - 2); - } - }, -}; - -console.log(yourself.fibonacci(2)); // 1 -console.log(yourself.fibonacci(10)); // 55 -``` - -
Answer - -```js -var yourself = { - fibonacci: function (n) { - let arr = [0, 1]; - for (let i = 2; i < n + 1; i++) { - arr.push(arr[i - 2] + arr[i - 1]); - } - return arr[n]; - }, -}; -``` - -
- - +
## Q. Predict the output of the following JS code? @@ -3043,59 +868,6 @@ console.log(searchValue("script")); ↥ back to top
-## Q. Write a program that prints the numbers from 1 to 15. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”? - -**Example:** - -```js -Input: 15 -Output: -1 -2 -Fizz -4 -Buzz -Fizz -7 -8 -Fizz -Buzz -11 -Fizz -13 -14 -FizzBuzz -``` - -
Answer - -**Solution - 01:** - -```javascript -for (var i = 1; i <= 15; i++) { - if (i % 15 == 0) console.log("FizzBuzz"); - else if (i % 3 == 0) console.log("Fizz"); - else if (i % 5 == 0) console.log("Buzz"); - else console.log(i); -} -``` - -**Solution - 02:** - -```javascript -for (var i = 1; i <= 15; i++) { - var f = i % 3 == 0, - b = i % 5 == 0; - console.log(f ? (b ? "FizzBuzz" : "Fizz") : b ? "Buzz" : i); -} -``` - -
- - - ## Q. What will be the output of the following code? ```javascript From 531aa2f3a5cdebccc9715cc965dee1dbbc3089eb Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 6 Nov 2022 08:46:20 +0530 Subject: [PATCH 056/117] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0773b97..a9e1896 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ## Related Interview Questions -* [JavaScript Program Writing Questions](program-writing) +* [JavaScript Program Writing Questions](program-writing.md)
From 74587adf56eb014fda349cdf5380a8824a693fd4 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 6 Nov 2022 10:31:14 +0530 Subject: [PATCH 057/117] Update README.md --- README.md | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/README.md b/README.md index a9e1896..5bcf050 100644 --- a/README.md +++ b/README.md @@ -3294,43 +3294,6 @@ console.log(result); ↥ back to top
-## Q. What will be the output of the following code? - -```javascript -// Example 01: -var prices = [12, 20, 18]; -var newPriceArray = [...prices]; -console.log(newPriceArray); - -// Example 02: -var alphabets = ["A", ..."BCD", "E"]; -console.log(alphabets); - -// Example 03: -var prices = [12, 20, 18]; -var maxPrice = Math.max(...prices); -console.log(maxPrice); - -// Example 04: -var max = Math.max(..."43210"); -console.log(max); - -// Example 05: -const fruits = ["apple", "orange"]; -const vegetables = ["carrot", "potato"]; - -const result = ["bread", ...vegetables, "chicken", ...fruits]; -console.log(result); - -// Example 06: -const country = "USA"; -console.log([...country]); -``` - - - ## Q. How many times the createVal function is called? ```javascript From 57df44d5d2dccbcb1568e5546d65bb955bc4b5af Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 6 Nov 2022 10:56:05 +0530 Subject: [PATCH 058/117] Update program-writing.md --- program-writing.md | 81 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/program-writing.md b/program-writing.md index 8f0cb80..076dd88 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2235,3 +2235,84 @@ for (var i = 1; i <= 15; i++) { + +## Q. There are some colored rabbits in a forest. Given an array arr[] of size N, such that arr[i] denotes the number of rabbits having same colors as the ith rabbit, the task is to find the minimum number of rabbits that could be in the forrest? + +**Examples:** + +```js +Input: arr[] = {2, 2, 0} +Output: 4 +Explanation: Considering the 1st and the 2nd rabbits to be of same color, eg. Blue, there should be 3 blue-colored rabbits. The third rabbit is the only rabbit of that color. Therefore, the minimum number of rabbits that could be present in the forest are = 3 + 1 = 4. + +Input: arr[] = {10, 10, 10} +Output: 11 +Explanation: Considering all the rabbits to be of the same color, the minimum number of rabbits present in forest are 10 + 1 = 11. +``` + +
Answer + +The approach to solving this problem is to find the number of groups of rabbits that have the same color and the number of rabbits in each group. Below are the steps: + +* Initialize a variable count to store the number of rabbits in each group. +* Initialize a map and traverse the array having key as arr[i] and value as occurrences of arr[i] in the given array. + +Now, if y rabbits answered x, then: + +* If (y%(x + 1)) is 0, then there must be (y / (x + 1)) groups of (x + 1) rabbits. +* If (y % (x + 1)) is non-zero, then there must be (y / (x + 1)) + 1 groups of (x + 1) rabbits. + +* Add the product of the number of groups and the number of rabbits in each group to the variable count. +* After the above steps, the value of count gives the minimum number of rabbits in the forest. + +```js +function solution(arr) { + // Initialize map + const map = new Map(); + const N = arr.length; + let count = 0; + + // Traverse array and map arr[i] + // to the number of occurrences + for (let a = 0; a < N; a++) { + if (map.has(arr[a])) { + map.set(arr[a], map.get(arr[a]) + 1); + } else { + map.set(arr[a], 1); + } + } + + // Find the number groups and + // no. of rabbits in each group + map.forEach((value, key) => { + let x = key; + let y = value; + + // Find number of groups and + // multiply them with number + // of rabbits in each group + if (y % (x + 1) == 0) { + count = count + parseInt(y / (x + 1)) * (x + 1); + } else { + count = count + (parseInt(y / (x + 1)) + 1) * (x + 1); + } + }); + + return count; +} + +// Test Case: 01 +console.log(solution([2, 2, 0])); // 4 + +// Test Case: 02 +console.log(solution([10, 10, 10])); // 11 + +// Test Case: 03 +console.log(solution([7, 7, 7])); // 8 +``` + +
+ + From 3866b3fefb6620aff3ec606fc1d2401ae6ca704f Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 6 Nov 2022 11:26:07 +0530 Subject: [PATCH 059/117] Update program-writing.md --- program-writing.md | 213 +++++++++++++++------------------------------ 1 file changed, 72 insertions(+), 141 deletions(-) diff --git a/program-writing.md b/program-writing.md index 076dd88..08bf1f9 100644 --- a/program-writing.md +++ b/program-writing.md @@ -4,17 +4,13 @@ ## Q. Write a function to accept argument like `sum(num1)(num2);` or `sum(num1,num2);` -**Example 1:** +**Examples:** ```js Input: sum(10)(20); Output: 30 Explanation: 10 + 20 = 30 -``` -**Example 2:** - -```js Input: sum(10, 20); Output: 30 Explanation: 10 + 20 = 30 @@ -51,8 +47,8 @@ console.log(sum(10)(20)); ```js Input: -var a1 = ['a', 'b']; -var a2 = ['a', 'b', 'c', 'd']; +const a1 = ['a', 'b']; +const a2 = ['a', 'b', 'c', 'd']; Output: ["c", "d"] @@ -499,42 +495,6 @@ function reverseBySeparator(string, separator) { ↥ back to top
-## Q. Implement enqueue and dequeue using only two stacks - -Enqueue means to add an element, dequeue to remove an element. - -
Answer - -```js -var inputStack = []; // First stack -var outputStack = []; // Second stack - -// For enqueue, just push the item into the first stack -function enqueue(stackInput, item) { - return stackInput.push(item); -} - -function dequeue(stackInput, stackOutput) { - // Reverse the stack such that the first element of the output stack is the - // last element of the input stack. After that, pop the top of the output to - // get the first element that was ever pushed into the input stack - if (stackOutput.length <= 0) { - while(stackInput.length > 0) { - var elementToOutput = stackInput.pop(); - stackOutput.push(elementToOutput); - } - } - - return stackOutput.pop(); -} -``` - -
- - - ## Q. Use a closure to create a private counter? **Example:** @@ -643,16 +603,12 @@ randomInteger(1, 100); // returns a random integer from 1 to 100 ## Q. Write a function to convert decimal number to binary number? -**Example 01:** +**Examples:** ```js Input: 10 Output: 1010 -``` - -**Example 02:** -```js Input: 7 Output: 111 ``` @@ -729,16 +685,12 @@ console.log(capitalizeFirstLetter("hello world")); // Hello World ## Q. Write a function which will test string as a literal and as an object? -**Example 01:** +**Examples:** ```js Input: const ltrlStr = "Hi I am string literal"; Output: It is a string literal -``` -**Example 02:** - -```js Input: const objStr = new String("Hi I am string object"); Output: It is an object of string ``` @@ -1095,25 +1047,15 @@ console.log(fibonnaci(5)); // 8 ↥ back to top
-## Q. Generate a random Number between min and max? +## Q. Write a function to reverse the number? -
Answer +**Example:** -```javascript -// 5 to 7 -let min = 5; -let max = 7; -console.log(min + Math.floor(Math.random() * (max - min + 1))); +```js +Input: 12345 +Output: 54321 ``` -
- - - -## Q. Write a function to reverse the number? -
Answer ```javascript @@ -1136,51 +1078,15 @@ console.log(reverse(12345)); ↥ back to top
-## Q. How to perform deep copy of object or clone of object? - -
Answer - -```javascript -function deepExtend(out = {}) { - for (let i = 1; i < arguments.length; i++) { - let obj = arguments[i]; - if (obj == null) - // skip undefined and null [check with double equal not triple] - continue; - - obj = Object(obj); - - for (let key in obj) { - // avoid shadow hasownproperty of parent - if (Object.prototype.hasOwnProperty.call(obj, key)) { - if ( - typeof obj[key] === "object" && - !Array.isArray(obj[key]) && - obj[key] != null - ) - out[key] = deepExtend(out[key], obj[key]); - else out[key] = obj[key]; - } - } - } - return out; -} +## Q. Write a function to reverse an array? -//Alternative if there are no function -let cloneObj = JSON.parse(JSON.stringify(obj)); +**Example:** -console.log(deepExtend({}, { a: 1, b: { c: 2, d: 3 } }, { e: 4, b: { f: 1 } })); -//output : { a: 1, b: {c: 2, d: 3, f: 1}, e: 4 } +```js +Input: {10, 20, 30, 40, 50} +Output: {50, 40, 30, 20, 10} ``` -
- - - -## Q. Write a function to reverse an array? -
Answer ```javascript @@ -1416,7 +1322,21 @@ console.log(mergeSortedArray([1, 2, 3, 4, 5, 6], [0, 3, 4, 7])); // [0, 1, 2, 3, ↥ back to top
-## Q. Anagram of words +## Q. Generate anagram of a given words? + +**Example:** + +```js +Input: {"map", "art", "how", "rat", "tar", "who", "pam", "shoop"} + +Output: +{ + amp: [ 'map', 'pam' ], + art: [ 'art', 'rat', 'tar' ], + how: [ 'how', 'who' ], + hoops: [ 'shoop' ] +} +```
Answer @@ -1435,15 +1355,7 @@ function groupAnagram(wordsArr) { }, {}); } -console.log( - groupAnagram(["map", "art", "how", "rat", "tar", "who", "pam", "shoop"]) -); -// result : { -// amp: ["map", "pam"], -// art: ["art", "rat", "tar"], -// hoops: ["shoop"], -// how: ["how", "who"] -// } +console.log(groupAnagram(["map", "art", "how", "rat", "tar", "who", "pam", "shoop"])); ```
@@ -1452,7 +1364,7 @@ console.log( ↥ back to top
-## Q. Print the largest (maximum) hourglass sum found in 2d array. +## Q. Print the largest (maximum) hourglass sum found in 2d array?
Answer @@ -1612,7 +1524,7 @@ console.log(flattenIterative1(list2)); // [0, 1, 2, 3, 4, 5] ↥ back to top
-## Q. Find max difference between two number in Array +## Q. Find max difference between two number in Array?
Answer @@ -1638,22 +1550,6 @@ console.log(maxDifference([1, 2, 4])); // [1 - 4 ] = 3 ↥ back to top
-## Q. swap two number in ES6 [destructing] - -
Answer - -```javascript -let a = 10, b = 5; - -[a, b] = [b, a]; -``` - -
- - - ## Q. Panagram ? it means all the 26 letters of alphabet are there
Answer @@ -1845,7 +1741,14 @@ e.emit("callme", ["a", "b"], { firstName: "umesh", lastName: "gohil" }); ↥ back to top
-## Q. Move all zero\'s to end +## Q. Move all zero\'s to end? + +**Example:** + +```js +Input: {1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0} +Output:{1, 8, 2, 3, 4, 5, 0, 0, 0, 0, 0} +```
Answer @@ -1862,7 +1765,7 @@ const moveZeroToEnd = (arr) => { return arr; }; -console.log(moveZeroToEnd([1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0])); // [1, 8, 2, 3, 4, 5, 0, 0, 0, 0, 0] +console.log(moveZeroToEnd([1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0])); ```
@@ -2243,11 +2146,14 @@ for (var i = 1; i <= 15; i++) { ```js Input: arr[] = {2, 2, 0} Output: 4 -Explanation: Considering the 1st and the 2nd rabbits to be of same color, eg. Blue, there should be 3 blue-colored rabbits. The third rabbit is the only rabbit of that color. Therefore, the minimum number of rabbits that could be present in the forest are = 3 + 1 = 4. +Explanation: Considering the 1st and the 2nd rabbits to be of same color, eg. Blue, there should be 3 blue-colored rabbits. +The third rabbit is the only rabbit of that color. Therefore, the minimum number of rabbits that could be present in the +forest are = 3 + 1 = 4. Input: arr[] = {10, 10, 10} Output: 11 -Explanation: Considering all the rabbits to be of the same color, the minimum number of rabbits present in forest are 10 + 1 = 11. +Explanation: Considering all the rabbits to be of the same color, the minimum number of rabbits present in forest are +10 + 1 = 11. ```
Answer @@ -2316,3 +2222,28 @@ console.log(solution([7, 7, 7])); // 8 + +## Q. Write a function solution that, given an array A of N integers, returns the largest integer K > 0 such that both values K and "-K" (the opposite number) exist in array A. If there is no such integer, the function should return 0? + +**Examples:** + +1. Given A = [3, 2, -2, 5, -3], the function should reutrn 3 (both 3 and -3 exist in array A). +2. Given A = [1, 1, 2, -1, 2, -1], the function should reutrn 1 (both 1 and -1 exist in array A). +3. Given A = [1, 2, 3, -4], the function should reutrn 0 (there is no such K for which both values K and -K exist in array A). + +Write an efficient algorithm for the following assumptions: + +* N is an integer within the range [1...100,000] +* each element of array A is an integer within the range [-1,000,000,000...1,000,000,000]. + +
Answer + + + +```js +function solution(arr) { + +} +``` + +
\ No newline at end of file From 52246254df317ea18c495011185d650281b5c8e3 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 6 Nov 2022 12:15:55 +0530 Subject: [PATCH 060/117] Update program-writing.md --- program-writing.md | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/program-writing.md b/program-writing.md index 08bf1f9..acfa88d 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2238,12 +2238,44 @@ Write an efficient algorithm for the following assumptions:
Answer - - ```js -function solution(arr) { +function solution(A) { + let s = new Set(); + let N = A.length; + let possible = []; + let ans = 0; + + for (let i = 0; i < N; i++) { + // If set has it's negation, check if it is max + if (s.has(A[i] * -1)) { + possible.push(Math.abs(A[i])); + } else { + s.add(A[i]); + } + } + // Find the maximum possible answer + for (let i = 0; i < possible.length; i++) { + if (possible[i] >= A[i]) { + ans = Math.max(ans, possible[i]); + } + } + + return ans; } + +// Test Case: 01 +console.log(solution([3, 2, -2, 5, -3])); // 3 + +// Test Case: 02 +console.log(solution([1, 1, 2, -1, 2, -1])); // 1 + +// Test Case: 03 +console.log(solution([1, 2, 3, -4])); // 0 ``` -
\ No newline at end of file +
+ + From 54a0a3380b1c57541fb9230c59e2929efa6bfb0b Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 6 Nov 2022 12:47:57 +0530 Subject: [PATCH 061/117] Update program-writing.md --- program-writing.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/program-writing.md b/program-writing.md index acfa88d..2edd54d 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2279,3 +2279,31 @@ console.log(solution([1, 2, 3, -4])); // 0 + +## Q. You are given an array of N integers. You want to split them into N/2 pairs in such a way that the sum of integers in each pair is odd. N is even nd every element of the array must be present in exactly one pair? + +Yous task is determine whether it is possible to split the numbers into such pairs. For example, given [2, 7, 4, 6, 3, 1], the answer is true. One of the possible sets of pairs is (2,7), (6,3) and (4,1).Their sums are respectively 9,9 and 5, all of which are odd. + +Write a function, which given an array of integers A of length N, returns true when it is possible to create the required pairs and false otherwise. + +**Examples:** + +1. Given A = [2, 7, 4, 3, 1], the function should return true, as explained above. +2. Given A = [-1, 1], the function should return false. The only possible pairs has the sum -1 + 1 = 0 which is even. +3. Given A = [2, -1], the function should return true. The only pair has sum -1 + 2 = 1, which is odd. +4. Given A = [1, 2, 4, 3], the function should return true. Possible pairs are (1,2), (4,3). They both have an odd sum. +5. Given A = [-1, -3, 4, 7, 7, 7], the function should return false. We can create only one pair with an odd sum by taking 4 and any of the other numbers: for example, 4 + 7 = 11. All the other pairs have an even sum. + +
Answer + +The idea is to observe the fact that if the count of even and odd numbers present in the given array are both even, only then, the given array can be divided into pairs having even sum by odd numbers together and even numbers together. Follow the steps below to solve the problem: + +Find the total number of odd and even elements present in the given array and store it in two variables, countEven and countOdd respectively. Check if both countEven and countOdd are even or not. + +```js +function solution(A) { + +} +``` + +
From a659c050258178f5703b44ce1674f76e926f7f00 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 6 Nov 2022 13:03:50 +0530 Subject: [PATCH 062/117] Update program-writing.md --- program-writing.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/program-writing.md b/program-writing.md index 2edd54d..a0e9800 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2280,9 +2280,9 @@ console.log(solution([1, 2, 3, -4])); // 0 ↥ back to top
-## Q. You are given an array of N integers. You want to split them into N/2 pairs in such a way that the sum of integers in each pair is odd. N is even nd every element of the array must be present in exactly one pair? +## Q. You are given an array of N integers. You want to split them into N/2 pairs in such a way that the sum of integers in each pair is odd. N is even and every element of the array must be present in exactly one pair? -Yous task is determine whether it is possible to split the numbers into such pairs. For example, given [2, 7, 4, 6, 3, 1], the answer is true. One of the possible sets of pairs is (2,7), (6,3) and (4,1).Their sums are respectively 9,9 and 5, all of which are odd. +Yous task is determine whether it is possible to split the numbers into such pairs. For example, given [2, 7, 4, 6, 3, 1], the answer is true. One of the possible sets of pairs is (2, 7), (6, 3) and (4, 1).Their sums are respectively 9, 9 and 5, all of which are odd. Write a function, which given an array of integers A of length N, returns true when it is possible to create the required pairs and false otherwise. @@ -2291,7 +2291,7 @@ Write a function, which given an array of integers A of length N, returns true w 1. Given A = [2, 7, 4, 3, 1], the function should return true, as explained above. 2. Given A = [-1, 1], the function should return false. The only possible pairs has the sum -1 + 1 = 0 which is even. 3. Given A = [2, -1], the function should return true. The only pair has sum -1 + 2 = 1, which is odd. -4. Given A = [1, 2, 4, 3], the function should return true. Possible pairs are (1,2), (4,3). They both have an odd sum. +4. Given A = [1, 2, 4, 3], the function should return true. Possible pairs are (1, 2), (4, 3). They both have an odd sum. 5. Given A = [-1, -3, 4, 7, 7, 7], the function should return false. We can create only one pair with an odd sum by taking 4 and any of the other numbers: for example, 4 + 7 = 11. All the other pairs have an even sum.
Answer From 7fb0f75f073f0072faffd8311db21237c7c03d04 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 6 Nov 2022 15:11:22 +0530 Subject: [PATCH 063/117] Update program-writing.md --- program-writing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program-writing.md b/program-writing.md index a0e9800..1f3fc35 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2282,7 +2282,7 @@ console.log(solution([1, 2, 3, -4])); // 0 ## Q. You are given an array of N integers. You want to split them into N/2 pairs in such a way that the sum of integers in each pair is odd. N is even and every element of the array must be present in exactly one pair? -Yous task is determine whether it is possible to split the numbers into such pairs. For example, given [2, 7, 4, 6, 3, 1], the answer is true. One of the possible sets of pairs is (2, 7), (6, 3) and (4, 1).Their sums are respectively 9, 9 and 5, all of which are odd. +Your task is determined whether it is possible to split the numbers into such pairs. For example, given [2, 7, 4, 6, 3, 1], the answer is true. One of the possible sets of pairs is (2, 7), (6, 3) and (4, 1).Their sums are respectively 9, 9 and 5, all of which are odd. Write a function, which given an array of integers A of length N, returns true when it is possible to create the required pairs and false otherwise. From e9a45217571b6a1feda006730a2497edc1d147c5 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 6 Nov 2022 17:18:09 +0530 Subject: [PATCH 064/117] Update program-writing.md --- program-writing.md | 69 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/program-writing.md b/program-writing.md index 1f3fc35..6f77ce3 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2296,14 +2296,77 @@ Write a function, which given an array of integers A of length N, returns true w
Answer -The idea is to observe the fact that if the count of even and odd numbers present in the given array are both even, only then, the given array can be divided into pairs having even sum by odd numbers together and even numbers together. Follow the steps below to solve the problem: +```js +function solution(A) { + +} +``` + +
+ + + +## Q. Student have been assigned a servies of math problems that have points associated with them. Given a sorted points array, minimize the number of problems a student needs to solve based on these criteria? + +1. They must always solve the first problem, index i = 0. +2. After Solving the math problem, they choose to solve the next problem (i+1) or skip ahead and solve the (i+2) problem. +3. Students must keep solving problems unit the difference between the maximum and minimum points questions solved so far meets or exceeds a specified threshold. +4. If students cannot meet or exceed the threshold, they must solve all the problems. + +Return the minimum number of problems a student needs to solve. + +**Example:** +threshold = 4 +points = [1, 2, 3, 5, 8] + +If a student solves points[0] = 1, points[2] = 3 and points[3] = 5, then the difference between the minimum and the maximum points solved is 5 -1 = 4. This meets the threshold, to the student must solve at least 3 problems. Return 3. -Find the total number of odd and even elements present in the given array and store it in two variables, countEven and countOdd respectively. Check if both countEven and countOdd are even or not. +points = [1, 2, 3, 5, 8] +min = 1 +max = 3, 5 + +If the threshold is 7, again it takes 3 problem solving 0,2 and 4 where points[4] - points[0] = 8-1=7. This meets the threshold, so the student must solve at least 3 problems. Return 3. + +If the threshold is greater than 7, then there is no way to meet the threshold. In that case, all problems need to be solved and the return value is 5. + +**Function Description:** + +Complete the function minNum in the editor below. + +minNum has the follwing parameters: + int threshold: the minimum difference +required + int points[n]: a sorted array of integers +Returns: + int: the minimum number of problems that must be solved + +**Constrainsts:** + +* 1 <= n <= 100 +* 1 <= points[i] <= 1000 +* 1 <= k <= 1000 + +
Answer ```js -function solution(A) { +/** + * Complete the 'minNum' functions below + * + * The function is expected to return an INTEGER. + * The function accepts following parameters: + * 1. INTEGER threshold + * 2. INTEGER_ARRAY points + */ + +function minNum(threshold, points) { } ```
+ + From 06a4cf23284862cf39ee45665dc02bf211a1efb4 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 6 Nov 2022 19:41:19 +0530 Subject: [PATCH 065/117] Update program-writing.md --- program-writing.md | 125 +++++++++++++++++++++++---------------------- 1 file changed, 63 insertions(+), 62 deletions(-) diff --git a/program-writing.md b/program-writing.md index 6f77ce3..9a48a91 100644 --- a/program-writing.md +++ b/program-writing.md @@ -16,7 +16,7 @@ Output: 30 Explanation: 10 + 20 = 30 ``` -
Answer +
Answer ```javascript function sum(x, y) { @@ -54,7 +54,7 @@ Output: ["c", "d"] ``` -
Answer +
Answer ```js let arr1 = ['a', 'b']; @@ -78,7 +78,7 @@ Input: [1, 2, 3, 4, 5, 6].diff([3, 4, 5]); Output: [1, 2, 6]; ``` -
Answer +
Answer ```js Array.prototype.diff = function (a) { @@ -99,7 +99,7 @@ console.log(dif1); // => [1, 2, 6] ## Q. Validate file size and extension before file upload in JavaScript? -
Answer +
Answer ```html @@ -146,7 +146,7 @@ File Extension: jpg ## Q. Create a captcha using javascript? -
Answer +
Answer ```html @@ -180,7 +180,7 @@ File Extension: jpg ## Q. Create a stopwatch in javascript? -
Answer +
Answer ```html @@ -264,7 +264,7 @@ File Extension: jpg ## Q. Write a program to reverse a string? -
Answer +
Answer ```javascript function reverseString(str) { @@ -287,7 +287,7 @@ console.log(reverseString("Hello")); ## Q. Create a Promise to accept car names as argument and send response once the argument matches with Maruti? -
Answer +
Answer ```js async function myCars(name) { @@ -334,7 +334,7 @@ Output: name, age, addressLine1, addressLine2, city ``` -
Answer +
Answer Write merge function which will take two object and add all the own property of second object into first object. @@ -390,7 +390,7 @@ Output: 8 ``` -
Answer +
Answer ```js /** @@ -422,7 +422,7 @@ function findMissingNumber(arrayOfIntegers, upperBound, lowerBound) { ## Q. Write a function to remove duplicates from an array in JavaScript? -
Answer +
Answer **1. Using set():** @@ -475,7 +475,7 @@ Input: "Hello World"; Output: "olleH dlroW"; ``` -
Answer +
Answer ```js const str = "Hello World"; @@ -501,7 +501,7 @@ function reverseBySeparator(string, separator) { You can create a function within an outer function (a closure) that allows you to update a private variable but the variable wouldn\'t be accessible from outside the function without the use of a helper function. -
Answer +
Answer ```js function counter() { @@ -548,7 +548,7 @@ Output: [40, 50] ``` -
Answer +
Answer ```js const arr = [10, 20, 30, 40, 50]; @@ -579,7 +579,7 @@ Input: 1, 100 Output: 63 ``` -
Answer +
Answer ```js /** @@ -613,7 +613,7 @@ Input: 7 Output: 111 ``` -
Answer +
Answer ```js function DecimalToBinary(number) { @@ -659,7 +659,7 @@ Input: hello world Output: Hello World ``` -
Answer +
Answer You can create a function which uses chain of string methods such as charAt, toUpperCase and slice methods to generate a string with first letter in uppercase. @@ -695,7 +695,7 @@ Input: const objStr = new String("Hi I am string object"); Output: It is an object of string ``` -
Answer +
Answer The `typeof` operator can be use to test string literal and `instanceof` operator to test String object. @@ -729,7 +729,7 @@ console.log(check(objStr)); // It is an object of string ## Q. How do you reversing an array? -
Answer +
Answer You can use reverse() method is used reverse the elements in an array. This method is useful to sort an array in descending order. Let us see the usage of reverse() method in an example, @@ -758,7 +758,7 @@ Min: 20 Max: 70 ``` -
Answer +
Answer You can use `Math.min` and `Math.max` methods on array variable to find the minimum and maximum elements with in an array. Let us create two functions to find the min and max value with in an array, @@ -785,7 +785,7 @@ console.log(findMax(marks)); ## Q. How do you find min and max values without Math functions? -
Answer +
Answer You can write functions which loops through an array comparing each value with the lowest value or highest value to find the min and max values. Let us create those functions to find min an max values, @@ -826,7 +826,7 @@ console.log(findMax(marks)); ## Q. Check if object is empty or not using javaScript? -
Answer +
Answer ```javascript function isEmpty(obj) { @@ -847,7 +847,7 @@ console.log(isEmpty(obj)); ## Q. Write a function to validate an email using regular expression? -
Answer +
Answer ```javascript function validateEmail(email) { @@ -868,7 +868,7 @@ console.log(validateEmail("pradeep.vwa@gmail.com")); // true ## Q. Use RegEx to test password strength in JavaScript? -
Answer +
Answer ```javascript let newPassword = "Pq5*@a{J"; @@ -905,7 +905,7 @@ PASS ## Q. Write a script that returns the number of occurrences of character given a string as input -
Answer +
Answer ```javascript function countCharacters(str) { @@ -929,7 +929,7 @@ console.log(countCharacters("the brown fox jumps over the lazy dog")); ## Q. Write a function that return the number of occurrences of a character in paragraph? -
Answer +
Answer ```javascript function charCount(str, searchChar) { @@ -955,7 +955,7 @@ console.log(charCount("the brown fox jumps over the lazy dog", "o")); ## Q. Write a recursive and non-recursive Factorial function? -
Answer +
Answer ```javascript function recursiveFactorial(n) { @@ -996,7 +996,7 @@ console.log(factorial(5)); ## Q. Write a recursive and non recursive fibonacci-sequence? -
Answer +
Answer ```javascript // 1, 1, 2, 3, 5, 8, 13, 21, 34 @@ -1056,7 +1056,7 @@ Input: 12345 Output: 54321 ``` -
Answer +
Answer ```javascript function reverse(num) { @@ -1087,7 +1087,7 @@ Input: {10, 20, 30, 40, 50} Output: {50, 40, 30, 20, 10} ``` -
Answer +
Answer ```javascript let a = [10, 20, 30, 40, 50]; @@ -1128,7 +1128,7 @@ Output: [4, 8, 12] ``` -
Answer +
Answer ```javascript const transpose = (arr) => arr[0].map((col, i) => arr.map((row) => row[i])); @@ -1150,7 +1150,7 @@ console.log( ## Q. Get Column from 2D Array -
Answer +
Answer ```javascript const getColumn = (arr, n) => arr.map((x) => x[n]); @@ -1172,7 +1172,7 @@ console.log(getColumn(twoDimensionalArray, 1)); //Result = [2,5,8] ## Q. Get top N from array -
Answer +
Answer ```javascript function topN(arr, num) { @@ -1191,7 +1191,7 @@ console.log(topN([1, 8, 3, 4, 5], 2)); // [5,8] ## Q. Get query params from Object -
Answer +
Answer ```javascript function getQueryParams(obj) { @@ -1224,7 +1224,7 @@ console.log( ## Q. Consecutive 1\'s in binary -
Answer +
Answer ```javascript function consecutiveOne(num) { @@ -1255,7 +1255,7 @@ console.log(consecutiveOne(5)); //1 ## Q. Spiral travesal of matrix -
Answer +
Answer ```javascript var input = [ @@ -1306,7 +1306,7 @@ console.log(spiralTraversal(input)); // [1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5 ## Q. Merge Sorted array and sort it. -
Answer +
Answer ```javascript function mergeSortedArray(arr1, arr2) { @@ -1338,7 +1338,7 @@ Output: } ``` -
Answer +
Answer ```javascript const alphabetize = (word) => word.split("").sort().join(""); @@ -1366,7 +1366,7 @@ console.log(groupAnagram(["map", "art", "how", "rat", "tar", "who", "pam", "shoo ## Q. Print the largest (maximum) hourglass sum found in 2d array? -
Answer +
Answer ```javascript // if arr 6 X 6 then iterate it till 4 X 4 [reduce by two] @@ -1400,7 +1400,7 @@ function main(arr) { ## Q. Transform array of object to array -
Answer +
Answer ```javascript let data = [ @@ -1438,7 +1438,7 @@ console.log(Object.keys(newData).map((key) => newData[key])); ## Q. Create a private variable or private method in object -
Answer +
Answer ```javascript let obj = (function () { @@ -1467,7 +1467,7 @@ obj.callPrivateFunction(); // this is private function ## Q. Flatten only Array not objects -
Answer +
Answer ```javascript function flatten(arr, result = []) { @@ -1526,7 +1526,7 @@ console.log(flattenIterative1(list2)); // [0, 1, 2, 3, 4, 5] ## Q. Find max difference between two number in Array? -
Answer +
Answer ```javascript function maxDifference(arr) { @@ -1552,7 +1552,7 @@ console.log(maxDifference([1, 2, 4])); // [1 - 4 ] = 3 ## Q. Panagram ? it means all the 26 letters of alphabet are there -
Answer +
Answer ```javascript function panagram(input) { @@ -1586,7 +1586,7 @@ processData("We promptly judged antique ivory buckles for the prize"); // Not Pa ## Q. Given two identical DOM trees (not the same one), and a node from one of them find the node in the other one. -
Answer +
Answer ```javascript function indexOf(arrLike, target) { @@ -1625,7 +1625,7 @@ console.log(locateNodeFromPath(rootB, getPath(rootA, target))); ## Q. Convert a number into a Roman Numeral -
Answer +
Answer ```javascript function romanize(num) { @@ -1665,7 +1665,7 @@ console.log(romanize(3)); // III ## Q. check if parenthesis is malformed or not -
Answer +
Answer ```javascript function matchParenthesis(str) { @@ -1701,7 +1701,7 @@ console.log(matchParenthesis("}{{}}"), matchParenthesis("{{[]}}")); // false - t ## Q. Create Custom Event Emitter class -
Answer +
Answer ```javascript class EventEmitter { @@ -1750,7 +1750,7 @@ Input: {1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0} Output:{1, 8, 2, 3, 4, 5, 0, 0, 0, 0, 0} ``` -
Answer +
Answer ```javascript const moveZeroToEnd = (arr) => { @@ -1776,7 +1776,7 @@ console.log(moveZeroToEnd([1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0])); ## Q. Decode message in matrix [diagional down right, diagional up right] -
Answer +
Answer ```javascript const decodeMessage = (mat) => { @@ -1829,7 +1829,7 @@ console.log(decodeMessage(mat)); //IROELEA ## Q. find a pair in array, whose sum is equal to given number? -
Answer +
Answer ```javascript const hasPairSum = (arr, sum) => { @@ -1884,7 +1884,7 @@ console.log(hasPairSum([6, 4, 3, 8], 8)); ## Q. Binary Search [Array should be sorted] -
Answer +
Answer ```javascript function binarySearch(arr, val) { @@ -1916,7 +1916,7 @@ console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 27)); ## Q. Write a function to generate Pascal triangle? -
Answer +
Answer ```javascript function pascalTriangle(n) { @@ -1942,7 +1942,7 @@ console.log(pascalTriangle(2)); ## Q. Remove array element based on object property? -
Answer +
Answer ```javascript var myArray = [ @@ -1995,7 +1995,7 @@ Output: console.log(getObjectProperty(data, 'user.username')); // Navin Chauhan ``` -
Answer +
Answer ```js const getObjectProperty = (object, path) => { @@ -2024,7 +2024,7 @@ Input: [1, 1, 3, 2, 3] Output: 2 ``` -
Answer +
Answer ```js const arr = [1, 1, 3, 2, 3]; @@ -2066,7 +2066,7 @@ console.log(yourself.fibonacci(2)); // 1 console.log(yourself.fibonacci(10)); // 55 ``` -
Answer +
Answer ```js var yourself = { @@ -2110,7 +2110,7 @@ Fizz FizzBuzz ``` -
Answer +
Answer **Solution - 01:** @@ -2156,7 +2156,7 @@ Explanation: Considering all the rabbits to be of the same color, the minimum nu 10 + 1 = 11. ``` -
Answer +
Answer The approach to solving this problem is to find the number of groups of rabbits that have the same color and the number of rabbits in each group. Below are the steps: @@ -2236,7 +2236,7 @@ Write an efficient algorithm for the following assumptions: * N is an integer within the range [1...100,000] * each element of array A is an integer within the range [-1,000,000,000...1,000,000,000]. -
Answer +
Answer ```js function solution(A) { @@ -2294,7 +2294,7 @@ Write a function, which given an array of integers A of length N, returns true w 4. Given A = [1, 2, 4, 3], the function should return true. Possible pairs are (1, 2), (4, 3). They both have an odd sum. 5. Given A = [-1, -3, 4, 7, 7, 7], the function should return false. We can create only one pair with an odd sum by taking 4 and any of the other numbers: for example, 4 + 7 = 11. All the other pairs have an even sum. -
Answer +
Answer ```js function solution(A) { @@ -2318,6 +2318,7 @@ function solution(A) { Return the minimum number of problems a student needs to solve. **Example:** + threshold = 4 points = [1, 2, 3, 5, 8] @@ -2348,7 +2349,7 @@ Returns: * 1 <= points[i] <= 1000 * 1 <= k <= 1000 -
Answer +
Answer ```js /** From 0856143a7388369ef6ba6315a5eeb4443d43ec31 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Tue, 8 Nov 2022 09:59:08 +0530 Subject: [PATCH 066/117] Update program-writing.md --- program-writing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program-writing.md b/program-writing.md index 9a48a91..50e4f47 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2308,7 +2308,7 @@ function solution(A) { ↥ back to top
-## Q. Student have been assigned a servies of math problems that have points associated with them. Given a sorted points array, minimize the number of problems a student needs to solve based on these criteria? +## Q. Student have been assigned a series of math problems that have points associated with them. Given a sorted pointer array, minimize the number of problems a student needs to solve based on these criteria? 1. They must always solve the first problem, index i = 0. 2. After Solving the math problem, they choose to solve the next problem (i+1) or skip ahead and solve the (i+2) problem. From 16d3d626c0fc8137ec9a0bf87dcf2c0ccf451ae3 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Tue, 8 Nov 2022 10:08:00 +0530 Subject: [PATCH 067/117] math problems --- assets/math-problems-puzzle.png | Bin 0 -> 15308 bytes program-writing.md | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 assets/math-problems-puzzle.png diff --git a/assets/math-problems-puzzle.png b/assets/math-problems-puzzle.png new file mode 100644 index 0000000000000000000000000000000000000000..b0c044d906002aaab8c7c21d621a77c29835e091 GIT binary patch literal 15308 zcmdVBRaBf!@HZGG!5Q2Mg9mqq05iC|6Ck(+cSwQ_?(T!Ty9IZ54?eiN?Y#fpJ!dcW ze0Sg3vlsJB^>a~OPf2%G_pgE#po;CH24b@ReU_fpVqiIy7PU z1ieiyn068u4zx{|Gxf<>a#|7<*Jn!1SQE3;wsWGs`ELKucGm1*O8V<3Iv`x2_)LXU z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4GVYvK}B-iYPQtd|9yIc}&W^H4T9@567pPExKJZ zMLHl43`Fd>EPO=M73$vzk`fi|)nC(0lJj`L8VmK}(r+5QUr=po5hZ{t^M8B$=>M{T f71O=%^^;ef^w^k|4!qg+%^NAOJg8js`=9> + math problems +

If the threshold is 7, again it takes 3 problem solving 0,2 and 4 where points[4] - points[0] = 8-1=7. This meets the threshold, so the student must solve at least 3 problems. Return 3. From 0e0b13f5f0191d087d63acd7f522d4af558c6328 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Tue, 8 Nov 2022 15:20:11 +0530 Subject: [PATCH 068/117] Update program-writing.md --- program-writing.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/program-writing.md b/program-writing.md index 767d9c0..c2f6c77 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2371,3 +2371,44 @@ function minNum(threshold, points) { + +## Q. Given a string return the character that appears the maximum number of times in the string. The string will contain only ASCII characters, from the ranges ('a'-'z', 'A'-'Z', '0'- '9'), and case matters. If there is a tie in the maximum number of times a character appears in the string, return the character that appears first in the string? + +**Example:** + +text = abbbaacc + +Both 'a' and 'b' occur 3 times in text. Since 'a' occurs earlier, 'a' is the answer. + +**Function Description:** + +Complete the function + +maximumOccurringCharacter in the editor below. + +maximumOccurringCharacter has the follwing paratermer: + string text: the string to be operated upon + +Returns + char: The most occurring character the appears first in the string. + +
Answer + +```js +/** + * Complete the 'maximumOccurringCharacter' function below. + * + * The function is expected to return a CHARACTER. + * The function accepts STRING text as parameter. + * + */ +function maximumOccurringCharacter(text) { + +} +``` + +
+ + From 269532fa0e749646a76f5bc81e02f57f741d3e3d Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Tue, 8 Nov 2022 15:54:40 +0530 Subject: [PATCH 069/117] Update program-writing.md --- program-writing.md | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/program-writing.md b/program-writing.md index c2f6c77..756382a 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2394,6 +2394,10 @@ Returns
Answer +* Create a count array of size 256 to store the frequency of every character of the string +* Maintain a max variable to store the maximum frequency so far whenever encounter a frequency more than max then update max +* Update that character in our result variable. + ```js /** * Complete the 'maximumOccurringCharacter' function below. @@ -2402,9 +2406,44 @@ Returns * The function accepts STRING text as parameter. * */ -function maximumOccurringCharacter(text) { +function maximumOccurringCharacter(str) { + // Create array to keep the count of individual + // characters and initialize the array as 0 + let ASCII_SIZE = 256; + let count = new Array(ASCII_SIZE); + for (let i = 0; i < ASCII_SIZE; i++) { + count[i] = 0; + } + + // Construct character count array from the input + // string. + let len = str.length; + for (let i = 0; i < len; i++) { + count[str[i].charCodeAt(0)] += 1; + } + let max = -1; // Initialize max count + let result = " "; // Initialize result + + // Traversing through the string and maintaining + // the count of each character + for (let i = 0; i < len; i++) { + if (max < count[str[i].charCodeAt(0)]) { + max = count[str[i].charCodeAt(0)]; + result = str[i]; + } + } + return result; } + +// Test Case: 01 +console.log(maximumOccurringCharacter('abbbaacc')); + +// Test Case: 02 +console.log(maximumOccurringCharacter('test sample')); + +// Test Case: 03 +console.log(maximumOccurringCharacter('sample program')); ```
From 45d7ff360601cb0c50d50989790e8cf3cfb592dd Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Wed, 9 Nov 2022 10:30:51 +0530 Subject: [PATCH 070/117] Update program-writing.md --- program-writing.md | 106 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/program-writing.md b/program-writing.md index 756382a..935bd33 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2451,3 +2451,109 @@ console.log(maximumOccurringCharacter('sample program')); + +## Q. A password manager wants to create new passwords using two trings given by the user, then combined to create a harder-to-guess combination. Given two strings, interleave the characters of the strings to create a new string. Begining with an empty string, alternately append a character from string a and from string b. If one of the string is exhausted befoe the other, append the remaining letters from the other string all at once. The result is the new password? + +**Example:** + +If a = 'hackerrank' and b = 'mountain', the result is hmaocuknetrariannk. + +**Function Description:** +Complete the function newPassword in the ediot below. + +newPassword has the follwing parametr(s): + string a: the first string + string b: the second string + +Reutrns: + string: the merged string + +**Constraints:** + +* 1 <= length of a,b <= 25000 +* All characters in a and b are lowercase letters in the range ascii['a'-'z'] + +
Answer + +```js +/** + * Complete the 'newPassword' function below. + * + * The function is expected to return a STRING. + * The function accepts following parameters: + * 1. STRING a + * 2. STRING b + */ + +function newPassword(a, b) { + + +} +``` + +
+ + + +## Q. You are in a browser-like environment, where you have access to the windwo object, and also $ - the jQuery library. The document contains a two-dimentional table. Each cell of the table has an upper-case letter in it and has its background color and text color text color set. Your taks is simply to read the letters in row-major order(top to bottom, left to right) concatenate them into a single string and reurn it. Howerver, you need to skip the letters that cannot be seen by the human eye. These are the ones whose colour is exactly the same as their background (that is, even marginal difference can be distinguished by a humn eye)? + +The table is create using "table", "tbody", "tr", and "td" tags. Each "td" tag has a "style" attribute with its CSS "background-color" and "color" attributes set. Thee is the same number of cells in each row. + +Wirte a function + function solution(); + +that, given a DOM tree representing an HTML document, return a string containing all visible letters, read in row-major order. + +For example, given a document which has the following table in its body: + +```html + + + + + + + + + + + + +
QYA
QMO
+``` + +which, when displayed in a browser, produces the following output: + +Your function should return "QAQO", since the letter "Y" and "M" are invisible. + +Note that innerText is not supported by the DOM. Please use textContent instead. + +Assume that: + +* the DOM tree represents a valid HTML5 document; +* there is excalty one table in the document, it has at leat one cell and every row has the same umber of cells; +* the only child of `` is ``; +* the length of the HTML document does not exceed 4KB; +* jQuery 2.1 is supported +* all colors are provided as hex codes; +* each pair of distinct colors occuring on input can be distinguished by a human eye (for exmaple #000000 is different than #000001). + +In your solution, focus on correctness. The performnace of your solution will not be the focus of the assessment. + +
Answer + +```js + +function solution() { + +} + +``` + +
+ + From ab89e22f13ac99699fce0da947e643f39a8bd641 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Wed, 9 Nov 2022 10:50:23 +0530 Subject: [PATCH 071/117] Update program-writing.md --- program-writing.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/program-writing.md b/program-writing.md index 935bd33..a089df3 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2526,21 +2526,24 @@ For example, given a document which has the following table in its body: which, when displayed in a browser, produces the following output: -Your function should return "QAQO", since the letter "Y" and "M" are invisible. + Q Y A + Q M O + +your function should return "QAQO", since the letters "Y" and "M" are invisible. Note that innerText is not supported by the DOM. Please use textContent instead. Assume that: * the DOM tree represents a valid HTML5 document; -* there is excalty one table in the document, it has at leat one cell and every row has the same umber of cells; +* there is exactly one table in the document, it has at least one cell and every row has the same number of cells; * the only child of `` is `
`; * the length of the HTML document does not exceed 4KB; -* jQuery 2.1 is supported +* jQuery 2.1 is supported; * all colors are provided as hex codes; -* each pair of distinct colors occuring on input can be distinguished by a human eye (for exmaple #000000 is different than #000001). +* each pair of distinct colors occuring on input can be distinguished by a human eye (for example #000000 is different than #000001). -In your solution, focus on correctness. The performnace of your solution will not be the focus of the assessment. +In your solution, focus on correctness. The performance of your solution will not be the focus of the assessment.
Answer From 3696825b70974a0d6a952c78a57c7c7eef350faa Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Wed, 9 Nov 2022 13:08:03 +0530 Subject: [PATCH 072/117] Update program-writing.md --- program-writing.md | 96 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/program-writing.md b/program-writing.md index a089df3..e77b1c6 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2560,3 +2560,99 @@ function solution() { + +## Q. You are given a string S. Deletion of the K-th letter of S costs C[K]. After deleting a letter, the costs of deleting other letters do not change. For example, for S = "ab" and C = [1, 3], after deleting 'a', deletion of 'b' will still cost 3. + +You want to delete some letters from S to obtain a string without two identical letters next to each other. What is the minimum total cost of deletions to achieve such a string? + +Write a function: + + function solution(S, C); + +that, given string S and array C of integers, both of length N, returns the minimum cost of all necessary deletions. + +**Examples:** + +1. Given S = "abccbd" and C = [0,1,2,3,4,5], the fucntion should return 2. You can delete the first occurence of 'c' to achieve "abcbd". +2. Given S = "aabbcc" and C = [1,2,1,2,1,2], the function should return 3. By deleting all letters with a cost of 1, you can achieve string "abc". +3. Given S = "aaaa" and C = [3,4,5,6], the function should return 12. You need to delete all but one letter 'a', and the lowest cost of deletions is 3+4+5 = 12. +4. Given S = "ababa" and C = [10,5,10,5,10], the function should return 0. There is no need to delete any letter. + +Write an efficient algorithm for the following assumptions: + +* string S and array C have length equal to N; +* N is an integer within the range [1...100,000]; +* string S is made only of lowercase letters (a-z); +* each element of array C is an integer within the range [0...1,000]. + +
Answer + +```js +function solution(S, C) { + let i = 0; + let N = S.length; + let ans = 0; + while (i < N) { + let j = i; + let sum = 0 + let mx = 1; + + for (; i < N && S[i] == S[j]; ++i) sum += C[i], mx = Math.max(mx, C[i]); + ans += sum - mx; + } + return ans; +} +``` + +
+ + + +## Q. You want to spend your next vacation in a foreign country. In the summer you are free for N consecutive days. You have consulted Travel Agency and learned that they are offering a trip to some interesting location in the country every day. For simplicity, each location si identified by a number 0 to N-1. Trips are described in a non-empty array A: for each K (0 <= K <= N), A[K] is the identifier of a location which is the destination of a trip offered on a day K. Travel Agency does not to offer trips to all locations, and can offer more than one trip to some locations? + +You want to go on a trip every day during your vacation. Moreover, you want to visit all locations offered by Travel Agency. You may visit the same location more than once, but you want to minimize duplicate visits. The goal is to find the shortest vacation (a range of consecutive days) that will allow you to visit all the locations offered by Travel Agency. + +For example, consider array A such that: + + A[0] = 7 + A[1] = 3 + A[2] = 7 + A[3] = 3 + A[4] = 1 + A[5] = 3 + A[6] = 4 + A[7] = 1 + +Travel Agency offers trips to four different locations (identified by numbers 1,3,4 and 7). The shortest vacation starting on day 0 that allows you visit all these locations ends on day 6 (thus is seven days long). However, a shorter vacation of five days (starting on day 2 and ending on day 6) also permits you to visit all locations. On Every vacation shorter than five days, you will have to miss at least one location. + +Write a function: + function solution(A); + +that, given a non-empty array A consisting of N integers, returns the length of the shortest vacation that allows you to visit all the offered locations. + +For example, given array A shown above, the function should return 5, as explained above. + +1. Given A = [2,1,1,3,2,1,1,3], the function should return 3. One of the shortest vacations that visits all the places starts on day 3(counting from 0) and lasts for 3 days. + +2. Given A = [7,5,2,7,2,7,4,7], the function should return 6. The shortest vacation that visits all the places starts on day 1(counting from 0) and lasts for 6 days. + +Write an efficient algorithm for the following assumptions: + +* N is an integer within the range[1...100,000]; +* each element of array A is an integer within the range[0...N - 1]. + +
Answer + +```js +function solution(S, C) { + +} +``` + +
+ + From b9599e4de3ea7ed37f7edd716ad22561223cf8b4 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Thu, 10 Nov 2022 17:05:00 +0530 Subject: [PATCH 073/117] Update program-writing.md --- program-writing.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/program-writing.md b/program-writing.md index e77b1c6..3262b0c 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2,6 +2,54 @@
+## Q. Write a function to get result in group by parameter? + +**Examples:** + +```js +const arry = [ + { Phase: "Phase 1", Step: "Step 1", Task: "Task 1", Value: "5"}, + { Phase: "Phase 1", Step: "Step 1", Task: "Task 2", Value: "10"}, + { Phase: "Phase 1", Step: "Step 2", Task: "Task 1", Value: "15"}, + { Phase: "Phase 1", Step: "Step 2", Task: "Task 2", Value: "20"}, + { Phase: "Phase 2", Step: "Step 1", Task: "Task 1", Value: "25"}, + { Phase: "Phase 2", Step: "Step 1", Task: "Task 2", Value: "30"} +]; + +// Output: +{ + 'Phase 1': [ + { Phase: 'Phase 1', Step: 'Step 1', Task: 'Task 1', Value: '5' }, + { Phase: 'Phase 1', Step: 'Step 1', Task: 'Task 2', Value: '10' }, + { Phase: 'Phase 1', Step: 'Step 2', Task: 'Task 1', Value: '15' }, + { Phase: 'Phase 1', Step: 'Step 2', Task: 'Task 2', Value: '20' } + ], + 'Phase 2': [ + { Phase: 'Phase 2', Step: 'Step 1', Task: 'Task 1', Value: '25' }, + { Phase: 'Phase 2', Step: 'Step 1', Task: 'Task 2', Value: '30' } + ] +} +``` + +
Answer + +```javascript +const groupBy = function (items, key) { + return items.reduce(function (result, item) { + (result[item[key]] = result[item[key]] || []).push(item); + return result; + }, {}); +}; + +console.log(groupBy(arry, "Phase")); +``` + +
+ + + ## Q. Write a function to accept argument like `sum(num1)(num2);` or `sum(num1,num2);` **Examples:** From 3f00c0027e41e83871ae0df81952bf1dda4c4002 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Fri, 11 Nov 2022 11:53:08 +0530 Subject: [PATCH 074/117] Update program-writing.md --- program-writing.md | 96 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 3 deletions(-) diff --git a/program-writing.md b/program-writing.md index 3262b0c..f4bf525 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2356,7 +2356,9 @@ function solution(A) { ↥ back to top -## Q. Student have been assigned a series of math problems that have points associated with them. Given a sorted pointer array, minimize the number of problems a student needs to solve based on these criteria? +## Q. Math Homework + +Student have been assigned a series of math problems that have points associated with them. Given a sorted pointer array, minimize the number of problems a student needs to solve based on these criteria? 1. They must always solve the first problem, index i = 0. 2. After Solving the math problem, they choose to solve the next problem (i+1) or skip ahead and solve the (i+2) problem. @@ -2420,7 +2422,9 @@ function minNum(threshold, points) { ↥ back to top -## Q. Given a string return the character that appears the maximum number of times in the string. The string will contain only ASCII characters, from the ranges ('a'-'z', 'A'-'Z', '0'- '9'), and case matters. If there is a tie in the maximum number of times a character appears in the string, return the character that appears first in the string? +## Q. Maximum Occuring Character + +Given a string return the character that appears the maximum number of times in the string. The string will contain only ASCII characters, from the ranges ('a'-'z', 'A'-'Z', '0'- '9'), and case matters. If there is a tie in the maximum number of times a character appears in the string, return the character that appears first in the string? **Example:** @@ -2500,7 +2504,9 @@ console.log(maximumOccurringCharacter('sample program')); ↥ back to top -## Q. A password manager wants to create new passwords using two trings given by the user, then combined to create a harder-to-guess combination. Given two strings, interleave the characters of the strings to create a new string. Begining with an empty string, alternately append a character from string a and from string b. If one of the string is exhausted befoe the other, append the remaining letters from the other string all at once. The result is the new password? +## Q. Password Creation + +A password manager wants to create new passwords using two trings given by the user, then combined to create a harder-to-guess combination. Given two strings, interleave the characters of the strings to create a new string. Begining with an empty string, alternately append a character from string a and from string b. If one of the string is exhausted befoe the other, append the remaining letters from the other string all at once. The result is the new password? **Example:** @@ -2704,3 +2710,87 @@ function solution(S, C) { + +## Q. JavaScript: Staff List + +The task is to create a class StaffList. The class will manage a collection of staff members, where each member is uniquely identified by a name. The class must have following methods: + +1. add(name, age): + * Paramters string name and integer age are passed to this function. + * If age is greater than 20, it adds the member with the given name to the collection. + * Else if age is less than or equal to 20, it throws an Error with the message 'Staff member age must be greater than 20'. + * It is guaranteed that at any time, if a member is in the collection, then no other member with the same name will be added to the collection. + +2. remove(name): + * If the memeber with the given name is in the collection, it removes the member from the collection and return true. + * Else if the member with the given name is not in the collection, it does nothing and return false. + +3. getSize(): + * returns the number of members in the collection. + +Your implementation of the class will be tested by a stubbed code on several input files. Each input file contains parameters for the functions calls. The functions will be called with those parameters, and the result of their executions will be printed to the standard output by the provided code. The stubbed code prints values returned by the remove(name) and getSize() functions and its also prints messages of all the cached errors. + +**Input formtat for Custom Testing:** +The first line contains an integer, n, denotating the number of operations to be performed. + +Each line i of the n subsequesnt lines(where 0 <= i <= n) contains space-seprarted strings, such that the first of them is the function name and the remaining ones, if any, are parameters for that function. + +**Sample Case 0:** +Sample Input For Customg Testing + +```js +5 +add John 25 +add Robin 23 +getSize +remove Robin +getSize +``` + +**Sample Output:** + +```js +2 +true +1 +``` + +**Explanation:** +There are 2 staff members, 'John' and 'Robin', who are added by calling the add Function twice. getSize is then called and returns the number of members in the collection, which is 2. Then the staff member 'Robin' is removed from the list by calling the remove function, and since the given name is in the collection, the return true is printed. Finally, getSize is called, which prints thr size of the collect, whcih is now 1 becuase 'Robin' was removed. + +
Answer + +```js +const List = []; + +class StaffList { + add(name, age) { + if (age > 20 && Object.values(List).indexOf(name) < 0) { + List.push({ name: name, age: age }); + } else { + throw "Error: Staff member age must be greater than 20"; + } + } + remove(name) { + if (List.some((el) => el.name === name)) { + const indexOfObject = List.findIndex((object) => { + return object.name === name; + }); + List.splice(indexOfObject, 1); + if(List) { + return true + } else return false; + + } else { + return false + } + } + getSize() { + return List.length; + } +} +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/hacker-rank-1-eyyp87?file=/index.js)** + +
From 4557f0b1891d11a7619e869bdff3e2f3caebfd59 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Fri, 11 Nov 2022 12:42:59 +0530 Subject: [PATCH 075/117] Update program-writing.md --- program-writing.md | 103 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/program-writing.md b/program-writing.md index f4bf525..131c9c4 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2794,3 +2794,106 @@ class StaffList { **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/hacker-rank-1-eyyp87?file=/index.js)**
+ + + +## Q. JavaScript: User Warning Data + +Implement the classes and methods to maintain user data using inheritance as described below. + +Create a class User and its methods as follows: + +* The constructor takes a single parameter, userName, and sets user name. +* The method getUsername() returns the username. +* The method setUsername(username) set\'s the username of the user to the given username. + +Create a class ChatUser that inherits User class and has the following methods: + +* The constructor takes a single parameter, userName, then sets username to userName and the initial warning count to 0. +* The method giveWarning() that increases the warning count by 1. +* The method getWarningCount() that returns the current warninig count. + +The locked stub code in the editor validates the correctness of the ChatUser class implementation by performing the follwing operations: + +* setName username: The operation updates the username. +* GiveWarining: This operation increases the warning count of the user. + +After performing all the operatons, the locked stub code prints the current username and warning count of the user. Finally, the user of inheritance is tested. + +**Input Format For Custom Testing:** +The first line contains a sting n, the initial username when the ChatUser object is created. +The second line contains an integer, m, the number of operations. +Each line i of the m subsequesnt lines(where 0<= i <= m) contains one of the tow operations listed above with a parameter if necessary. + +**Sample Input For Custom Testing:** + +```js +STDIN Function +------- --------- +Jay -> username = Jay +5 -> number of operatirons = 5 +GiveWarning -> first operation +GiveWarning +SetName JayMenon +GiveWarning +GiveWarning -> fifth operation +``` + +**Sample Output:** + +```js +User JayMenon has a warning count of 4 +ChatUser extends User: true +``` + +**Explanation:** +A ChatUser ibject is created with the username 'Jay'. As per the given operations, the name is set to JayMenon and the warning count is increased 4 times. Henece the final outpt is 'User JayMenon has warning cout of 4'. The last line checks if ChatUser inherits the User class. + +
Answer + +```js +let warningCount = 0; + +class User { + constructor(userName) { + this.userName = userName; + } + getUsername() { + return this.userName; + } + setUsername(userName) { + this.userName = userName; + } +} + +class ChatUser extends User { + constructor(userName) { + super(userName); + this.username = userName; + this.warningCount = 0; + } + giveWarning() { + this.warningCount++; + } + getWarningCount() { + return this.warningCount; + } +} + +const chatUserObj = new ChatUser("Jay"); +console.log(chatUserObj.giveWarning()); +console.log(chatUserObj.giveWarning()); +console.log(chatUserObj.setUsername("JayMenon")); +console.log(chatUserObj.giveWarning()); +console.log(chatUserObj.giveWarning()); +``` + +**⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/hacker-rank-2-kxgvrz?file=/script.js)** + +
+ + From 230d572b3291b4ed35999e9e0b503ab1c461f1c5 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Fri, 11 Nov 2022 12:45:53 +0530 Subject: [PATCH 076/117] Update program-writing.md --- program-writing.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/program-writing.md b/program-writing.md index 131c9c4..72d68e8 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2731,12 +2731,12 @@ The task is to create a class StaffList. The class will manage a collection of s Your implementation of the class will be tested by a stubbed code on several input files. Each input file contains parameters for the functions calls. The functions will be called with those parameters, and the result of their executions will be printed to the standard output by the provided code. The stubbed code prints values returned by the remove(name) and getSize() functions and its also prints messages of all the cached errors. **Input formtat for Custom Testing:** + The first line contains an integer, n, denotating the number of operations to be performed. Each line i of the n subsequesnt lines(where 0 <= i <= n) contains space-seprarted strings, such that the first of them is the function name and the remaining ones, if any, are parameters for that function. -**Sample Case 0:** -Sample Input For Customg Testing +**Sample Input For Customg Testing:** ```js 5 @@ -2756,6 +2756,7 @@ true ``` **Explanation:** + There are 2 staff members, 'John' and 'Robin', who are added by calling the add Function twice. getSize is then called and returns the number of members in the collection, which is 2. Then the staff member 'Robin' is removed from the list by calling the remove function, and since the given name is in the collection, the return true is printed. Finally, getSize is called, which prints thr size of the collect, whcih is now 1 becuase 'Robin' was removed.
Answer @@ -2823,6 +2824,7 @@ The locked stub code in the editor validates the correctness of the ChatUser cla After performing all the operatons, the locked stub code prints the current username and warning count of the user. Finally, the user of inheritance is tested. **Input Format For Custom Testing:** + The first line contains a sting n, the initial username when the ChatUser object is created. The second line contains an integer, m, the number of operations. Each line i of the m subsequesnt lines(where 0<= i <= m) contains one of the tow operations listed above with a parameter if necessary. @@ -2849,6 +2851,7 @@ ChatUser extends User: true ``` **Explanation:** + A ChatUser ibject is created with the username 'Jay'. As per the given operations, the name is set to JayMenon and the warning count is increased 4 times. Henece the final outpt is 'User JayMenon has warning cout of 4'. The last line checks if ChatUser inherits the User class.
Answer From aab874609c7b7879f1cc2b643604a06474ece589 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Fri, 11 Nov 2022 14:55:13 +0530 Subject: [PATCH 077/117] Update program-writing.md --- program-writing.md | 72 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 59 insertions(+), 13 deletions(-) diff --git a/program-writing.md b/program-writing.md index 72d68e8..e5e7462 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2134,13 +2134,39 @@ var yourself = { ↥ back to top -## Q. Write a program that prints the numbers from 1 to 15. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”? +## Q. FizzBuzz -**Example:** +Given a number n, for each integer i in the range from 1 to n inclusive, print one vale per line as follows: + +* If i is a multiple of both 3 and 5, print FizzBuzz. +* If i is a multiple of 3 (but not 5), print Fizz. +* If i is a mupitple of 5 (but not 3), print Buzz. +* If i is not a multiple of 3 or 5, print the value of i. + +**Function Description:** + +Complete the function fizzBuzz in the editor below. + +fuzzBuzz has the following parameters: + + int n: upper limit of values to test(inclusive) + +Rerutns: NONE +Prints: +The function must print the appropriate response for each value i in the set {1, 2,...n} in ascending order, each on a separate line. + +**Sample Input:** + +```js +STDIN Function +------ ----------- + 15 -> n = 15 + +``` + +**Sample Output:** ```js -Input: 15 -Output: 1 2 Fizz @@ -2158,27 +2184,47 @@ Fizz FizzBuzz ``` +**Explanation:** + +The numbers 3, 6, 9, and 12 are multiples of 3 (but not 5), so print Fizz on those lines. +The numbers 5 and 10 are multiples of 5 (bit not 3), so print Buzz on those lines. +The number 15 is a multiple of both 3 and 5, so print FizzBuzz on that line. +None of the other values is a multiple of either 3 or 5, so print the value of i on those lines. +
Answer **Solution - 01:** ```javascript -for (var i = 1; i <= 15; i++) { - if (i % 15 == 0) console.log("FizzBuzz"); - else if (i % 3 == 0) console.log("Fizz"); - else if (i % 5 == 0) console.log("Buzz"); - else console.log(i); +function fizzBuzz(n) { + for (let i = 1; i <= n; i++) { + if (i % 15 == 0) { + console.log("FizzBuzz"); + } else if (i % 3 == 0) { + console.log("Fizz"); + } else if (i % 5 == 0) { + console.log("Buzz"); + } else { + console.log(i); + } + } } + +fizzBuzz(15); ``` **Solution - 02:** ```javascript -for (var i = 1; i <= 15; i++) { - var f = i % 3 == 0, - b = i % 5 == 0; - console.log(f ? (b ? "FizzBuzz" : "Fizz") : b ? "Buzz" : i); +function fizzBuzz(n) { + for (let i = 1; i <= n; i++) { + const f = i % 3 == 0; + const b = i % 5 == 0; + console.log(f ? (b ? "FizzBuzz" : "Fizz") : b ? "Buzz" : i); + } } + +fizzBuzz(15); ```
From 322326ccc46a314823dbe874cf4f219fce10acb2 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Fri, 11 Nov 2022 15:47:56 +0530 Subject: [PATCH 078/117] Update program-writing.md --- program-writing.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/program-writing.md b/program-writing.md index e5e7462..2ccbca7 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2149,11 +2149,11 @@ Complete the function fizzBuzz in the editor below. fuzzBuzz has the following parameters: - int n: upper limit of values to test(inclusive) +* int n: upper limit of values to test(inclusive) -Rerutns: NONE -Prints: -The function must print the appropriate response for each value i in the set {1, 2,...n} in ascending order, each on a separate line. +* Rerutns: NONE + +* Prints: The function must print the appropriate response for each value i in the set {1, 2,...n} in ascending order, each on a separate line. **Sample Input:** From 76b69bf828c29ddadbebc8dcb455e3c9c9133e37 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 13 Nov 2022 10:15:25 +0530 Subject: [PATCH 079/117] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5bcf050..2efac13 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@
-## Related Interview Questions +## Related Topics -* [JavaScript Program Writing Questions](program-writing.md) +* *[JavaScript Program Writing](program-writing.md)*
From ee7f0f55f685c7b7f8d0f36d29b43003d7f98b9d Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 13 Nov 2022 10:16:37 +0530 Subject: [PATCH 080/117] Update program-writing.md --- program-writing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program-writing.md b/program-writing.md index 2ccbca7..a37ed51 100644 --- a/program-writing.md +++ b/program-writing.md @@ -1,4 +1,4 @@ -# JavaScript Program Writing Questions +# JavaScript Program Writing
From 197f9d29dff88b24b24c16af3dd73d9fdf241d30 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Fri, 18 Nov 2022 08:28:36 +0530 Subject: [PATCH 081/117] Update README.md --- README.md | 420 +++++++++++++++++++++++++++--------------------------- 1 file changed, 210 insertions(+), 210 deletions(-) diff --git a/README.md b/README.md index 2efac13..805862f 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ b.msg = "Hello"; console.log(a, b); ``` -
Answer +
Answer ```js { msg: 'Hello' } { msg: 'Hello' } @@ -41,7 +41,7 @@ let b = [4, 5, 6]; console.log(a + b); ``` -
Answer +
Answer ```js 1, 2, 34, 5, 6 @@ -69,7 +69,7 @@ arr2[2] = 50; console.log(arr2) ``` -
Answer +
Answer ```js [10, 20, 30, 40] @@ -94,7 +94,7 @@ obj.getName(); obj2.getName(); ``` -
Answer +
Answer ```js Neha @@ -117,7 +117,7 @@ array[1].name = ""; console.log(array[0].name); ``` -
Answer +
Answer ```js undefined @@ -145,7 +145,7 @@ b(); console.log(a); ``` -
Answer +
Answer ```js 1 @@ -173,7 +173,7 @@ setTimeout(()=>{ console.log('C'); ``` -
Answer +
Answer ```js A @@ -207,7 +207,7 @@ new Promise((resolve, reject) => { console.log(3); ``` -
Answer +
Answer ```js 1 @@ -248,7 +248,7 @@ something(); console.log("5"); ``` -
Answer +
Answer ```js 1 @@ -879,7 +879,7 @@ var output = (function (x) { console.log(output); ``` -
Answer +
Answer The code above will output `0` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it\'s **local variable**. `delete` operator doesn\'t affect local variables. @@ -901,7 +901,7 @@ var output = (function () { console.log(output); ``` -
Answer +
Answer The code above will output `1` as output. `delete` operator is used to delete a property from an object. Here `x` is not an object it\'s **global variable** of type `number`. @@ -923,7 +923,7 @@ var output = (function () { console.log(output); ``` -
Answer +
Answer The code above will output `undefined` as output. `delete` operator is used to delete a property from an object. Here `x` is an object which has foo as a property and from a self-invoking function, we are deleting the `foo` property of object `x` and after deletion, we are trying to reference deleted property `foo` which result `undefined`. @@ -944,7 +944,7 @@ delete emp1.company; console.log(emp1.company); ``` -
Answer +
Answer The code above will output `xyz` as output. Here `emp1` object got company as **prototype** property. delete operator doesn\'t delete prototype property. @@ -964,7 +964,7 @@ delete trees[3]; console.log(trees.length); ``` -
Answer +
Answer The code above will output `5` as output. When we used `delete` operator for deleting an array element then, the array length is not affected by this. This holds even if you deleted all elements of an array using `delete` operator. @@ -986,7 +986,7 @@ console.log(bar + true); console.log(bar + false); ``` -
Answer +
Answer The code above will output `1, "truexyz", 2, 1` as output. Here\'s a general guideline for the plus operator: @@ -1011,7 +1011,7 @@ var z = 1, console.log(y); ``` -
Answer +
Answer The code above will print string `"undefined"` as output. According to associativity rule operator with the same precedence are processed based on their associativity property of operator. Here associativity of the assignment operator is `Right to Left` so first `typeof y` will evaluate first which is string `"undefined"` and assigned to `z` and then `y` would be assigned the value of z. The overall sequence will look like that: @@ -1035,7 +1035,7 @@ var foo = function bar() { typeof bar(); ``` -
Answer +
Answer The output will be `Reference Error`. To fix the bug we can try to rewrite the code a little bit: @@ -1089,7 +1089,7 @@ function bar() { } ``` -
Answer +
Answer The output will be : @@ -1120,7 +1120,7 @@ var salary = "1000$"; })(); ``` -
Answer +
Answer The code above will output: `undefined, 5000$` because of hoisting. In the code presented above, you might be expecting `salary` to retain it values from outer scope until the point that `salary` was re-declared in the inner scope. But due to `hoisting` salary value was `undefined` instead. To understand it better have a look of the following code, here `salary` variable is hoisted and declared at the top in function scope. When we print its value using `console.log` the result is `undefined`. Afterwards the variable is redeclared and the new value `"5000$"` is assigned to it. @@ -1154,7 +1154,7 @@ var person = (new User("xyz")["location"] = "USA"); console.log(person); ``` -
Answer +
Answer The output of above code would be `"USA"`. Here `new User("xyz")` creates a brand new object and created property `location` on that and `USA` has been assigned to object property location and that has been referenced by the person. @@ -1189,7 +1189,7 @@ strB = "bye there!"; console.log(strA); ``` -
Answer +
Answer The output will `'hi there'` because we\'re dealing with strings here. Strings are passed by value, that is, copied. @@ -1209,7 +1209,7 @@ objB.prop1 = 90; console.log(objA); ``` -
Answer +
Answer The output will `{prop1: 90}` because we\'re dealing with objects here. Objects are passed by reference, that is, `objA` and `objB` point to the same object in memory. @@ -1229,7 +1229,7 @@ objB = {}; console.log(objA); ``` -
Answer +
Answer The output will `{prop1: 42}`. @@ -1254,7 +1254,7 @@ arrB[0] = 42; console.log(arrA); ``` -
Answer +
Answer The output will be `[42,1,2,3,4,5]`. @@ -1277,7 +1277,7 @@ arrB[0] = 42; console.log(arrA); ``` -
Answer +
Answer The output will be `[0,1,2,3,4,5]`. @@ -1305,7 +1305,7 @@ arrB[0].prop1 = 42; console.log(arrA); ``` -
Answer +
Answer The output will be `[{prop1: 42}, {someProp: "also value of array A!"}, 3,4,5]`. @@ -1334,7 +1334,7 @@ arrB[3] = 20; console.log(arrA); ``` -
Answer +
Answer The output will be `[{prop1: 42}, {someProp: "also value of array A!"}, 3,4,5]`. @@ -1368,7 +1368,7 @@ This is why changing the property of `arrB[0]` in `arrB` will also change the `a ## Q. console.log(employeeId); -
Answer +
Answer ReferenceError: employeeId is not defined @@ -1385,7 +1385,7 @@ console.log(employeeId); var employeeId = "19000"; ``` -
Answer +
Answer undefined @@ -1405,7 +1405,7 @@ var employeeId = "1234abe"; })(); ``` -
Answer +
Answer undefined @@ -1428,7 +1428,7 @@ var employeeId = "1234abe"; })(); ``` -
Answer +
Answer ```js undefined @@ -1451,7 +1451,7 @@ undefined })(); ``` -
Answer +
Answer undefined @@ -1473,7 +1473,7 @@ foo(); console.log(employeeId); ``` -
Answer +
Answer '123bcd' @@ -1499,7 +1499,7 @@ foo(); console.log(employeeId); ``` -
Answer +
Answer 'abc123' @@ -1525,7 +1525,7 @@ function foo() { foo(); ``` -
Answer +
Answer 'function' @@ -1550,7 +1550,7 @@ function foo() { foo(); ``` -
Answer +
Answer 1) undefined @@ -1577,7 +1577,7 @@ foo(); })(); ``` -
Answer +
Answer function function @@ -1608,7 +1608,7 @@ function function })(); ``` -
Answer +
Answer ["name", "salary", "country", "phoneNo"] @@ -1639,7 +1639,7 @@ function function })(); ``` -
Answer +
Answer ["name", "salary", "country"] @@ -1666,7 +1666,7 @@ function function })(); ``` -
Answer +
Answer false false @@ -1687,7 +1687,7 @@ false false })(); ``` -
Answer +
Answer false false @@ -1712,7 +1712,7 @@ false false })(); ``` -
Answer +
Answer false false @@ -1735,7 +1735,7 @@ false false })(); ``` -
Answer +
Answer false false @@ -1758,7 +1758,7 @@ false false })(); ``` -
Answer +
Answer true true @@ -1783,7 +1783,7 @@ true true })(); ``` -
Answer +
Answer true true true true @@ -1807,7 +1807,7 @@ true true true true })(); ``` -
Answer +
Answer bar bar @@ -1833,7 +1833,7 @@ bar bar })(); ``` -
Answer +
Answer foo foo @@ -1859,7 +1859,7 @@ foo foo })(); ``` -
Answer +
Answer undefined undefined @@ -1879,7 +1879,7 @@ undefined undefined })(); ``` -
Answer +
Answer ["100"] 1 @@ -1903,7 +1903,7 @@ undefined undefined })(); ``` -
Answer +
Answer [] [] [Array[5]] 1 @@ -1924,7 +1924,7 @@ undefined undefined })(); ``` -
Answer +
Answer 11 @@ -1945,7 +1945,7 @@ undefined undefined })(); ``` -
Answer +
Answer 6 @@ -1966,7 +1966,7 @@ undefined undefined })(); ``` -
Answer +
Answer [ 'dog', 'rat', 'goat', 'cow', 'horse', 'cat' ] @@ -1988,7 +1988,7 @@ undefined undefined })(); ``` -
Answer +
Answer 1) 1 -1 -1 4 @@ -2009,7 +2009,7 @@ undefined undefined })(); ``` -
Answer +
Answer 1 6 -1 @@ -2037,7 +2037,7 @@ undefined undefined })(); ``` -
Answer +
Answer [ 2, 4, 8, 12, 16 ] true @@ -2064,7 +2064,7 @@ undefined undefined })(); ``` -
Answer +
Answer [ 2, '12', true ] [ 2, '12', true ] @@ -2090,7 +2090,7 @@ undefined undefined })(); ``` -
Answer +
Answer [ 'bar', 'john', 'ritz' ] [ 'bar', 'john' ] @@ -2115,7 +2115,7 @@ undefined undefined })(); ``` -
Answer +
Answer [ 'bar', 'john' ] [] [ 'foo' ] @@ -2135,7 +2135,7 @@ undefined undefined })(); ``` -
Answer +
Answer [ 15, 16, 2, 23, 42, 8 ] @@ -2161,7 +2161,7 @@ function funcA() { console.log(funcA()); ``` -
Answer +
Answer funcA innerFunc1 @@ -2186,7 +2186,7 @@ var obj = { console.log(obj.innerMessage); ``` -
Answer +
Answer undefined true @@ -2209,7 +2209,7 @@ var obj = { console.log(obj.innerMessage()); ``` -
Answer +
Answer Hello @@ -2233,7 +2233,7 @@ var obj = { console.log(obj.innerMessage()); ``` -
Answer +
Answer undefined @@ -2258,7 +2258,7 @@ var obj = { console.log(obj.innerMessage()); ``` -
Answer +
Answer 'Hello' @@ -2279,7 +2279,7 @@ myFunc.message = "Hi John"; console.log(myFunc()); ``` -
Answer +
Answer undefined @@ -2300,7 +2300,7 @@ myFunc.message = "Hi John"; console.log(myFunc()); ``` -
Answer +
Answer 'Hi John' @@ -2320,7 +2320,7 @@ function myFunc() { console.log(myFunc()); ``` -
Answer +
Answer 'Hi John' @@ -2341,7 +2341,7 @@ console.log(myFunc("a", "b")); console.log(myFunc("a", "b", "c", "d")); ``` -
Answer +
Answer 2 2 2 @@ -2362,7 +2362,7 @@ console.log(myFunc("a", "b")); console.log(myFunc("a", "b", "c", "d")); ``` -
Answer +
Answer 0 2 4 @@ -2394,7 +2394,7 @@ person1.displayName(); Person.displayName(); ``` -
Answer +
Answer John Person @@ -2420,7 +2420,7 @@ console.log(userInfo.pwd); console.log(userInfo.userName); ``` -
Answer +
Answer 12345678 undefined @@ -2440,7 +2440,7 @@ function Employee() { console.log(Employee.employeeId); ``` -
Answer +
Answer undefined @@ -2465,7 +2465,7 @@ console.log(new Employee().JobId); console.log(new Employee().employeeId); ``` -
Answer +
Answer bq1uy 1BJKSJ bq1uy @@ -2489,7 +2489,7 @@ var employeeId = "aq123"; })(); ``` -
Answer +
Answer foo123 aq123 @@ -2511,7 +2511,7 @@ foo123 aq123 })(); ``` -
Answer +
Answer [ 'W', 'o', 'r', 'l', 'd' ] @@ -2545,7 +2545,7 @@ foo123 aq123 })(); ``` -
Answer +
Answer Total amount left in account: 5600 Total amount left in account: 5300 @@ -2580,7 +2580,7 @@ Total amount left in account: 5600 Total amount left in account: 5300 })(); ``` -
Answer +
Answer 5600 5300 5100 @@ -2615,7 +2615,7 @@ Total amount left in account: 5600 Total amount left in account: 5300 })(); ``` -
Answer +
Answer 3600 3300 3100 @@ -2635,7 +2635,7 @@ Total amount left in account: 5600 Total amount left in account: 5300 })()); ``` -
Answer +
Answer Hello John @@ -2662,7 +2662,7 @@ getDataFromServer("www.google.com").then(function (name) { }); ``` -
Answer +
Answer John @@ -2705,7 +2705,7 @@ John })(); ``` -
Answer +
Answer [ 2, 8, 15, 16, 23, 42 ] [ 2, 8, 15, 16, 23, 42 ] @@ -2732,7 +2732,7 @@ John })(); ``` -
Answer +
Answer Uncaught TypeError: Cannot read property 'fullName' of undefined @@ -2753,7 +2753,7 @@ var numb = getNumber(); console.log(numb); ``` -
Answer +
Answer 5 @@ -2774,7 +2774,7 @@ var numb = getNumber(); console.log(numb); ``` -
Answer +
Answer undefined @@ -2802,7 +2802,7 @@ console.log(mul(2)(3)[0]); console.log(mul(2)(3)[1](4)); ``` -
Answer +
Answer 6, 10 @@ -2829,7 +2829,7 @@ console.log(mul(2)(3).result); console.log(mul(2)(3).sum(4)); ``` -
Answer +
Answer 6, 10 @@ -2856,7 +2856,7 @@ function mul(x) { console.log(mul(2)(3)(4)(5)(6)); ``` -
Answer +
Answer 720 @@ -2872,7 +2872,7 @@ console.log(mul(2)(3)(4)(5)(6)); var foo = 10 + "20"; ``` -
Answer +
Answer `'1020'`, because of type coercion from Number to String @@ -2889,7 +2889,7 @@ add(2, 5); // 7 add(2)(5); // 7 ``` -
Answer +
Answer A general solution for any number of parameters @@ -2928,7 +2928,7 @@ add()()(2)(5); // 7 "i'm a lasagna hog".split("").reverse().join(""); ``` -
Answer +
Answer It\'s actually a reverse method for a string - `'goh angasal a m\'i'` @@ -2944,7 +2944,7 @@ It\'s actually a reverse method for a string - `'goh angasal a m\'i'` window.foo || (window.foo = "bar"); ``` -
Answer +
Answer Always `'bar'` @@ -2965,7 +2965,7 @@ var foo = "Hello"; alert(foo + bar); ``` -
Answer +
Answer _Answer:_ @@ -2986,7 +2986,7 @@ foo.push(1); foo.push(2); ``` -
Answer +
Answer `.push` is mutable - `2` @@ -3004,7 +3004,7 @@ var bar = foo; foo.x = foo = { n: 2 }; ``` -
Answer +
Answer `undefined`. Rather, `bar.x` is `{n: 2}`. @@ -3030,7 +3030,7 @@ setTimeout(function () { console.log("three"); ``` -
Answer +
Answer `one`, `three` and `two`. It\'s because `console.log('two');` will be invoked in the next event loop. @@ -3043,7 +3043,7 @@ invoked in the next event loop. ## Q. What would be the result of 1+2+'3'? -
Answer +
Answer The output is going to be `33`. Since `1` and `2` are numeric values, the result of first two digits is going to be a numeric value `3`. The next digit is a string type value because of that the addition of numeric value `3` and string type value `3` is just going to be a concatenation value `33`. @@ -3059,7 +3059,7 @@ The output is going to be `33`. Since `1` and `2` are numeric values, the result var foo = 10 + "20"; ``` -
Answer +
Answer `'1020'`, because of type coercion from Number to String @@ -3076,7 +3076,7 @@ var foo = 10 + "20"; if( !(x > 100) ) {...} ``` -
Answer +
Answer `NaN <= 100` is `false` and `NaN > 100` is also false, so if the value of `x` is `NaN`, the statements are not the same. @@ -3237,7 +3237,7 @@ for (var i = 0; i < arr.length; i++) { } ``` -
Answer +
Answer For ES6, you can just replace `var i` with `let i`. @@ -3335,7 +3335,7 @@ function sayHi() { sayHi(); ``` -
Answer +
Answer @@ -3361,7 +3361,7 @@ for (let i = 0; i < 3; i++) { } ``` -
Answer +
Answer Because of the event queue in JavaScript, the `setTimeout` callback function is called _after_ the loop has been executed. Since the variable `i` in the first loop was declared using the `var` keyword, this value was global. During the loop, we incremented the value of `i` by `1` each time, using the unary operator `++`. By the time the `setTimeout` callback function was invoked, `i` was equal to `3` in the first example. @@ -3388,7 +3388,7 @@ console.log(shape.diameter()); console.log(shape.perimeter()); ``` -
Answer +
Answer Note that the value of `diameter` is a regular function, whereas the value of `perimeter` is an arrow function. @@ -3409,7 +3409,7 @@ There is no value `radius` on that object, which returns `undefined`. !"Lydia"; ``` -
Answer +
Answer The unary plus tries to convert an operand to a number. `true` is `1`, and `false` is `0`. @@ -3434,7 +3434,7 @@ const mouse = { }; ``` -
Answer +
Answer In JavaScript, all object keys are strings (unless it\'s a Symbol). Even though we might not _type_ them as strings, they are always converted into strings under the hood. @@ -3461,7 +3461,7 @@ c.greeting = "Hello"; console.log(d.greeting); ``` -
Answer +
Answer In JavaScript, all objects interact by _reference_ when setting them equal to each other. @@ -3489,7 +3489,7 @@ console.log(a === b); console.log(b === c); ``` -
Answer +
Answer `new Number()` is a built-in function constructor. Although it looks like a number, it\'s not really a number: it has a bunch of extra features and is an object. @@ -3521,7 +3521,7 @@ const freddie = new Chameleon({ newColor: "purple" }); console.log(freddie.colorChange("orange")); ``` -
Answer +
Answer The `colorChange` function is static. Static methods are designed to live only on the constructor in which they are created, and cannot be passed down to any children. Since `freddie` is a child, the function is not passed down, and not available on the `freddie` instance: a `TypeError` is thrown. @@ -3539,7 +3539,7 @@ greetign = {}; // Typo! console.log(greetign); ``` -
Answer +
Answer It logs the object, because we just created an empty object on the global object! When we mistyped `greeting` as `greetign`, the JS interpreter actually saw this as `global.greetign = {}` (or `window.greetign = {}` in a browser). @@ -3561,7 +3561,7 @@ function bark() { bark.animal = "dog"; ``` -
Answer +
Answer This is possible in JavaScript, because functions are objects! (Everything besides primitive types are objects) @@ -3589,7 +3589,7 @@ Person.getFullName = function () { console.log(member.getFullName()); ``` -
Answer +
Answer You can\'t add properties to a constructor like you can with regular objects. If you want to add a feature to all objects at once, you have to use the prototype instead. So in this case, @@ -3622,7 +3622,7 @@ console.log(lydia); console.log(sarah); ``` -
Answer +
Answer For `sarah`, we didn\'t use the `new` keyword. When using `new`, it refers to the new empty object we create. However, if you don\'t add `new` it refers to the **global object**! @@ -3641,7 +3641,7 @@ We said that `this.firstName` equals `"Sarah"` and `this.lastName` equals `"Smit - C: Target > Bubbling > Capturing - D: Capturing > Target > Bubbling -
Answer +
Answer **Answer: D** @@ -3660,7 +3660,7 @@ During the **capturing** phase, the event goes through the ancestor elements dow - A: true - B: false -
Answer +
Answer **Answer: B** @@ -3682,7 +3682,7 @@ function sum(a, b) { sum(1, "2"); ``` -
Answer +
Answer JavaScript is a **dynamically typed language**: we don\'t specify what types certain variables are. Values can automatically be converted into another type without you knowing, which is called _implicit type coercion_. **Coercion** is converting from one type into another. @@ -3703,7 +3703,7 @@ console.log(++number); console.log(number); ``` -
Answer +
Answer The **postfix** unary operator `++`: @@ -3738,7 +3738,7 @@ const age = 21; getPersonInfo`${person} is ${age} years old`; ``` -
Answer +
Answer If you use tagged template literals, the value of the first argument is always an array of the string values. The remaining arguments get the values of the passed expressions! @@ -3764,7 +3764,7 @@ function checkAge(data) { checkAge({ age: 18 }); ``` -
Answer +
Answer When testing equality, primitives are compared by their _value_, while objects are compared by their _reference_. JavaScript checks if the objects have a reference to the same location in memory. @@ -3788,7 +3788,7 @@ function getAge(...args) { getAge(21); ``` -
Answer +
Answer The rest parameter (`...args`.) lets us "collect" all remaining arguments into an array. An array is an object, so `typeof args` returns `"object"` @@ -3810,7 +3810,7 @@ function getAge() { getAge(); ``` -
Answer +
Answer With `"use strict"`, you can make sure that you don\'t accidentally declare global variables. We never declared the variable `age`, and since we use `"use strict"`, it will throw a reference error. If we didn\'t use `"use strict"`, it would have worked, since the property `age` would have gotten added to the global object. @@ -3826,7 +3826,7 @@ With `"use strict"`, you can make sure that you don\'t accidentally declare glob const sum = eval("10*10+5"); ``` -
Answer +
Answer `eval` evaluates codes that\'s passed as a string. If it\'s an expression, like in this case, it evaluates the expression. The expression is `10 * 10 + 5`. This returns the number `105`. @@ -3842,7 +3842,7 @@ const sum = eval("10*10+5"); sessionStorage.setItem("cool_secret", 123); ``` -
Answer +
Answer @@ -3865,7 +3865,7 @@ var num = 10; console.log(num); ``` -
Answer +
Answer With the `var` keyword, you can declare multiple variables with the same name. The variable will then hold the latest value. You cannot do this with `let` or `const` since they\'re block-scoped. @@ -3888,7 +3888,7 @@ set.has("1"); set.has(1); ``` -
Answer +
Answer All object keys (excluding Symbols) are strings under the hood, even if you don\'t type it yourself as a string. This is why `obj.hasOwnProperty('1')` also returns true. @@ -3907,7 +3907,7 @@ const obj = { a: "one", b: "two", a: "three" }; console.log(obj); ``` -
Answer +
Answer If you have two keys with the same name, the key will be replaced. It will still be in its first position, but with the last specified value. @@ -3919,11 +3919,11 @@ If you have two keys with the same name, the key will be replaced. It will still ## Q. The JavaScript global execution context creates two things for you: the global object, and the "this" keyword. -- A: true -- B: false -- C: it depends +- [ ] `true` +- [ ] `false` +- [ ] `it depends` -
Answer +
Answer **Answer: A** @@ -3944,7 +3944,7 @@ for (let i = 1; i < 5; i++) { } ``` -
Answer +
Answer The `continue` statement skips an iteration if a certain condition returns `true`. @@ -3966,7 +3966,7 @@ const name = "Lydia"; name.giveLydiaPizza(); ``` -
Answer +
Answer `String` is a built-in constructor, which we can add properties to. I just added a method to its prototype. Primitive strings are automatically converted into a string object, generated by the string prototype function. So, all strings (string objects) have access to that method! @@ -3989,7 +3989,7 @@ a[c] = 456; console.log(a[b]); ``` -
Answer +
Answer Object keys are automatically converted into strings. We are trying to set an object as a key to object `a`, with the value of `123`. @@ -4015,7 +4015,7 @@ foo(); baz(); ``` -
Answer +
Answer We have a `setTimeout` function and invoked it first. Yet, it was logged last. @@ -4059,7 +4059,7 @@ This is where an event loop starts to work. An **event loop** looks at the stack ``` -
Answer +
Answer The deepest nested element that caused the event is the target of the event. You can stop bubbling by `event.stopPropagation` @@ -4077,7 +4077,7 @@ The deepest nested element that caused the event is the target of the event. You ``` -
Answer +
Answer If we click `p`, we see two logs: `p` and `div`. During event propagation, there are 3 phases: capturing, target, and bubbling. By default, event handlers are executed in the bubbling phase (unless you set `useCapture` to `true`). It goes from the deepest nested element outwards. @@ -4100,7 +4100,7 @@ sayHi.call(person, 21); sayHi.bind(person, 21); ``` -
Answer +
Answer With both, we can pass the object to which we want the `this` keyword to refer to. However, `.call` is also _executed immediately_! @@ -4122,7 +4122,7 @@ function sayHi() { console.log(typeof sayHi()); ``` -
Answer +
Answer The `sayHi` function returns the returned value of the immediately invoked function (IIFE). This function returned `0`, which is type `"number"`. @@ -4145,7 +4145,7 @@ new Boolean(false); undefined; ``` -
Answer +
Answer There are only six falsy values: @@ -4170,7 +4170,7 @@ Function constructors, like `new Number` and `new Boolean` are truthy. console.log(typeof typeof 1); ``` -
Answer +
Answer `typeof 1` returns `"number"`. `typeof "number"` returns `"string"` @@ -4189,7 +4189,7 @@ numbers[10] = 11; console.log(numbers); ``` -
Answer +
Answer When you set a value to an element in an array that exceeds the length of the array, JavaScript creates something called "empty slots". These actually have the value of `undefined`, but you will see something like: @@ -4219,7 +4219,7 @@ depending on where you run it (it\'s different for every browser, node, etc.) })(); ``` -
Answer +
Answer The `catch` block receives the argument `x`. This is not the same `x` as the variable when we pass arguments. This variable `x` is block-scoped. @@ -4240,7 +4240,7 @@ Outside of the `catch` block, `x` is still `undefined`, and `y` is `2`. When we - C: trick question! only objects - D: number or object -
Answer +
Answer JavaScript only has primitive types and objects. @@ -4268,7 +4268,7 @@ What differentiates a primitive from an object is that primitives do not have an ); ``` -
Answer +
Answer `[1, 2]` is our initial value. This is the value we start with, and the value of the very first `acc`. During the first round, `acc` is `[1,2]`, and `cur` is `[0, 1]`. We concatenate them, which results in `[1, 2, 0, 1]`. @@ -4288,7 +4288,7 @@ Then, `[1, 2, 0, 1]` is `acc` and `[2, 3]` is `cur`. We concatenate them, and ge !!1; ``` -
Answer +
Answer `null` is falsy. `!null` returns `true`. `!true` returns `false`. @@ -4308,7 +4308,7 @@ Then, `[1, 2, 0, 1]` is `acc` and `[2, 3]` is `cur`. We concatenate them, and ge setInterval(() => console.log("Hi"), 1000); ``` -
Answer +
Answer It returns a unique id. This id can be used to clear that interval with the `clearInterval()` function. @@ -4324,7 +4324,7 @@ It returns a unique id. This id can be used to clear that interval with the `cle [..."Lydia"]; ``` -
Answer +
Answer A string is an iterable. The spread operator maps every character of an iterable to one element. @@ -4348,7 +4348,7 @@ console.log(gen.next().value); console.log(gen.next().value); ``` -
Answer +
Answer Regular functions cannot be stopped mid-way after invocation. However, a generator function can be "stopped" midway, and later continue from where it stopped. Every time a generator function encounters a `yield` keyword, the function yields the value specified after it. Note that the generator function in that case doesn\'t _return_ the value, it _yields_ the value. @@ -4376,7 +4376,7 @@ const secondPromise = new Promise((res, rej) => { Promise.race([firstPromise, secondPromise]).then((res) => console.log(res)); ``` -
Answer +
Answer When we pass multiple promises to the `Promise.race` method, it resolves/rejects the _first_ promise that resolves/rejects. To the `setTimeout` method, we pass a timer: 500ms for the first promise (`firstPromise`), and 100ms for the second promise (`secondPromise`). This means that the `secondPromise` resolves first with the value of `'two'`. `res` now holds the value of `'two'`, which gets logged. @@ -4396,7 +4396,7 @@ person = null; console.log(members); ``` -
Answer +
Answer First, we declare a variable `person` with the value of an object that has a `name` property. @@ -4431,7 +4431,7 @@ for (const item in person) { } ``` -
Answer +
Answer With a `for-in` loop, we can iterate through object keys, in this case `name` and `age`. Under the hood, object keys are strings (if they\'re not a Symbol). On every loop, we set the value of `item` equal to the current key it’s iterating over. First, `item` is equal to `name`, and gets logged. Then, `item` is equal to `age`, which gets logged. @@ -4447,7 +4447,7 @@ With a `for-in` loop, we can iterate through object keys, in this case `name` an console.log(3 + 4 + "5"); ``` -
Answer +
Answer Operator associativity is the order in which the compiler evaluates the expressions, either left-to-right or right-to-left. This only happens if all operators have the _same_ precedence. We only have one type of operator: `+`. For addition, the associativity is left-to-right. @@ -4467,7 +4467,7 @@ Operator associativity is the order in which the compiler evaluates the expressi const num = parseInt("7*6", 10); ``` -
Answer +
Answer Only the first numbers in the string is returned. Based on the _radix_ (the second argument in order to specify what type of number we want to parse it to: base 10, hexadecimal, octal, binary, etc.), the `parseInt` checks whether the characters in the string are valid. Once it encounters a character that isn\'t a valid number in the radix, it stops parsing and ignores the following characters. @@ -4488,7 +4488,7 @@ Only the first numbers in the string is returned. Based on the _radix_ (the seco }); ``` -
Answer +
Answer When mapping over the array, the value of `num` is equal to the element it’s currently looping over. In this case, the elements are numbers, so the condition of the if statement `typeof num === "number"` returns `true`. The map function creates a new array and inserts the values returned from the function. @@ -4516,7 +4516,7 @@ getInfo(person, birthYear); console.log(person, birthYear); ``` -
Answer +
Answer Arguments are passed by _value_, unless their value is an object, then they\'re passed by _reference_. `birthYear` is passed by value, since it\'s a string, not an object. When we pass arguments by value, a _copy_ of that value is created (see question 46). @@ -4549,7 +4549,7 @@ function sayHi() { sayHi(); ``` -
Answer +
Answer With the `throw` statement, we can create custom errors. With this statement, you can throw exceptions. An exception can be a string, a number, a boolean or an object. In this case, our exception is the string `'Hello world'`. @@ -4573,7 +4573,7 @@ const myCar = new Car(); console.log(myCar.make); ``` -
Answer +
Answer When you return a property, the value of the property is equal to the _returned_ value, not the value set in the constructor function. We return the string `"Maserati"`, so `myCar.make` is equal to `"Maserati"`. @@ -4594,7 +4594,7 @@ console.log(typeof x); console.log(typeof y); ``` -
Answer +
Answer `let x = y = 10;` is actually shorthand for: @@ -4637,7 +4637,7 @@ delete Dog.prototype.bark; pet.bark(); ``` -
Answer +
Answer We can delete properties from objects using the `delete` keyword, also on the prototype. By deleting a property on the prototype, it is not available anymore in the prototype chain. In this case, the `bark` function is not available anymore on the prototype after `delete Dog.prototype.bark`, yet we still try to access it. @@ -4657,7 +4657,7 @@ const set = new Set([1, 1, 2, 3, 4]); console.log(set); ``` -
Answer +
Answer The `Set` object is a collection of _unique_ values: a value can only occur once in a set. @@ -4686,7 +4686,7 @@ myCounter += 1; console.log(myCounter); ``` -
Answer +
Answer An imported module is _read-only_: you cannot modify the imported module. Only the module that exports them can change its value. @@ -4708,7 +4708,7 @@ console.log(delete name); console.log(delete age); ``` -
Answer +
Answer The `delete` operator returns a boolean value: `true` on a successful deletion, else it'll return `false`. However, variables declared with the `var`, `const` or `let` keyword cannot be deleted using the `delete` operator. @@ -4729,7 +4729,7 @@ const [y] = numbers; console.log(y); ``` -
Answer +
Answer We can unpack values from arrays or properties from objects through destructuring. For example: @@ -4764,7 +4764,7 @@ const admin = { admin: true, ...user }; console.log(admin); ``` -
Answer +
Answer It\'s possible to combine objects using the spread operator `...`. It lets you create copies of the key/value pairs of one object, and add them to another object. In this case, we create copies of the `user` object, and add them to the `admin` object. The `admin` object now contains the copied key/value pairs, which results in `{ admin: true, name: "Lydia", age: 21 }`. @@ -4785,7 +4785,7 @@ console.log(person); console.log(Object.keys(person)); ``` -
Answer +
Answer With the `defineProperty` method, we can add new properties to an object, or modify existing ones. When we add a property to an object using the `defineProperty` method, they are by default _not enumerable_. The `Object.keys` method returns all _enumerable_ property names from an object, in this case only `"name"`. @@ -4810,7 +4810,7 @@ const data = JSON.stringify(settings, ["level", "health"]); console.log(data); ``` -
Answer +
Answer The second argument of `JSON.stringify` is the _replacer_. The replacer can either be a function or an array, and lets you control what and how the values should be stringified. @@ -4839,7 +4839,7 @@ console.log(num1); console.log(num2); ``` -
Answer +
Answer The unary operator `++` _first returns_ the value of the operand, _then increments_ the value of the operand. The value of `num1` is `10`, since the `increaseNumber` function first returns the value of `num`, which is `10`, and only increments the value of `num` afterwards. @@ -4866,7 +4866,7 @@ multiply(value); multiply(value); ``` -
Answer +
Answer In ES6, we can initialize parameters with a default value. The value of the parameter will be the default value, if no other value has been passed to the function, or if the value of the parameter is `"undefined"`. In this case, we spread the properties of the `value` object into a new object, so `x` has the default value of `{ number: 10 }`. @@ -4888,7 +4888,7 @@ The fourth time, we pass the `value` object again. `x.number` was previously mod [1, 2, 3, 4].reduce((x, y) => console.log(x, y)); ``` -
Answer +
Answer The first argument that the `reduce` method receives is the _accumulator_, `x` in this case. The second argument is the _current value_, `y`. With the reduce method, we execute a callback function on every element in the array, which could ultimately result in one single value. @@ -4940,7 +4940,7 @@ class Labrador extends Dog { } ``` -
Answer +
Answer In a derived class, you cannot access the `this` keyword before calling `super`. If you try to do that, it will throw a ReferenceError: 1 and 4 would throw a reference error. @@ -4967,7 +4967,7 @@ console.log("running sum.js"); export const sum = (a, b) => a + b; ``` -
Answer +
Answer With the `import` keyword, all imported modules are _pre-parsed_. This means that the imported modules get run _first_, the code in the file which imports the module gets executed _after_. @@ -4987,7 +4987,7 @@ console.log(Boolean(false) === Boolean(false)); console.log(Symbol("foo") === Symbol("foo")); ``` -
Answer +
Answer Every Symbol is entirely unique. The purpose of the argument passed to the Symbol is to give the Symbol a description. The value of the Symbol is not dependent on the passed argument. As we test equality, we are creating two entirely new symbols: the first `Symbol('foo')`, and the second `Symbol('foo')`. These two values are unique and not equal to each other, `Symbol('foo') === Symbol('foo')` returns `false`. @@ -5005,7 +5005,7 @@ console.log(name.padStart(13)); console.log(name.padStart(2)); ``` -
Answer +
Answer With the `padStart` method, we can add padding to the beginning of a string. The value passed to this method is the _total_ length of the string together with the padding. The string `"Lydia Hallie"` has a length of `12`. `name.padStart(13)` inserts 1 space at the start of the string, because 12 + 1 is 13. @@ -5023,7 +5023,7 @@ If the argument passed to the `padStart` method is smaller than the length of th console.log(String.raw`Hello\nworld`); ``` -
Answer +
Answer `String.raw` returns a string where the escapes (`\n`, `\v`, `\t` etc.) are ignored! Backslashes can be an issue since you could end up with something like: @@ -5056,7 +5056,7 @@ const data = getData(); console.log(data); ``` -
Answer +
Answer An async function always returns a promise. The `await` still has to wait for the promise to resolve: a pending promise gets returned when we call `getData()` in order to set `data` equal to it. @@ -5083,7 +5083,7 @@ const result = addToList("apple", ["banana"]); console.log(result); ``` -
Answer +
Answer The `.push()` method returns the _length_ of the new array! Previously, the array contained one element (the string `"banana"`) and had a length of `1`. After adding the string `"apple"` to the array, the array contains two elements, and has a length of `2`. This gets returned from the `addToList` function. @@ -5108,7 +5108,7 @@ shape.x = 100; console.log(shape); ``` -
Answer +
Answer `Object.freeze` makes it impossible to add, remove, or modify properties of an object (unless the property\'s value is another object). @@ -5130,7 +5130,7 @@ const { name: myName } = { name: "Lydia" }; console.log(name); ``` -
Answer +
Answer When we unpack the property `name` from the object on the right-hand side, we assign its value `"Lydia"` to a variable with the name `myName`. @@ -5166,7 +5166,7 @@ console.log(addFunction(10)); console.log(addFunction(5 * 2)); ``` -
Answer +
Answer The `add` function is a _memoized_ function. With memoization, we can cache the results of a function in order to speed up its execution. In this case, we create a `cache` object that stores the previously returned values. @@ -5191,7 +5191,7 @@ const list = [1 + 2, 1 * 2, 1 / 2]; console.log(list); ``` -
Answer +
Answer Array elements can hold any value. Numbers, strings, objects, other arrays, null, boolean values, undefined, and other expressions such as dates, functions, and calculations. @@ -5213,7 +5213,7 @@ function sayHi(name) { console.log(sayHi()); ``` -
Answer +
Answer By default, arguments have the value of `undefined`, unless a value has been passed to the function. In this case, we didn\'t pass a value for the `name` argument. `name` is equal to `undefined` which gets logged. @@ -5243,7 +5243,7 @@ city = "Amsterdam"; console.log(person); ``` -
Answer +
Answer We set the variable `city` equal to the value of the property called `city` on the `person` object. There is no property on this object called `city`, so the variable `city` has the value of `undefined`. @@ -5275,7 +5275,7 @@ function checkAge(age) { console.log(checkAge(21)); ``` -
Answer +
Answer Variables with the `const` and `let` keyword are _block-scoped_. A block is anything between curly brackets (`{ }`). In this case, the curly brackets of the if/else statements. You cannot reference a variable outside of the block it\'s declared in, a ReferenceError gets thrown. @@ -5293,7 +5293,7 @@ fetch("https://www.website.com/api/user/1") .then((res) => console.log(res)); ``` -
Answer +
Answer The value of `res` in the second `.then` is equal to the returned value of the previous `.then`. You can keep chaining `.then`s like this, where the value is passed to the next handler. @@ -5311,7 +5311,7 @@ function getName(name) { } ``` -
Answer +
Answer With `!!name`, we determine whether the value of `name` is truthy or falsy. If name is truthy, which we want to test for, `!name` returns `false`. `!false` (which is what `!!name` practically is) returns `true`. @@ -5333,7 +5333,7 @@ By setting `hasName` equal to `name`, you set `hasName` equal to whatever value console.log("I want pizza"[0]); ``` -
Answer +
Answer In order to get an character on a specific index in a string, you can use bracket notation. The first character in the string has index 0, and so on. In this case we want to get the element which index is 0, the character `"I'`, which gets logged. @@ -5355,7 +5355,7 @@ function sum(num1, num2 = num1) { sum(10); ``` -
Answer +
Answer You can set a default parameter\'s value equal to another parameter of the function, as long as they\'ve been defined _before_ the default parameter. We pass the value `10` to the `sum` function. If the `sum` function only receives 1 argument, it means that the value for `num2` is not passed, and the value of `num1` is equal to the passed value `10` in this case. The default value of `num2` is the value of `num1`, which is `10`. `num1 + num2` returns `20`. @@ -5380,7 +5380,7 @@ import * as data from "./module"; console.log(data); ``` -
Answer +
Answer With the `import * as name` syntax, we import _all exports_ from the `module.js` file into the `index.js` file as a new object called `data` is created. In the `module.js` file, there are two exports: the default export, and a named export. The default export is a function which returns the string `"Hello World"`, and the named export is a variable called `name` which has the value of the string `"Lydia"`. @@ -5405,7 +5405,7 @@ const member = new Person("John"); console.log(typeof member); ``` -
Answer +
Answer Classes are syntactical sugar for function constructors. The equivalent of the `Person` class as a function constructor would be: @@ -5431,7 +5431,7 @@ let newList = [1, 2, 3].push(4); console.log(newList.push(5)); ``` -
Answer +
Answer The `.push` method returns the _new length_ of the array, not the array itself! By setting `newList` equal to `[1, 2, 3].push(4)`, we set `newList` equal to the new length of the array: `4`. @@ -5457,7 +5457,7 @@ console.log(giveLydiaPizza.prototype); console.log(giveLydiaChocolate.prototype); ``` -
Answer +
Answer Regular functions, such as the `giveLydiaPizza` function, have a `prototype` property, which is an object (prototype object) with a `constructor` property. Arrow functions however, such as the `giveLydiaChocolate` function, do not have this `prototype` property. `undefined` gets returned when trying to access the `prototype` property using `giveLydiaChocolate.prototype`. @@ -5480,7 +5480,7 @@ for (const [x, y] of Object.entries(person)) { } ``` -
Answer +
Answer `Object.entries(person)` returns an array of nested arrays, containing the keys and objects: @@ -5507,7 +5507,7 @@ function getItems(fruitList, ...args, favoriteFruit) { getItems(["banana", "apple"], "pear", "orange") ``` -
Answer +
Answer `...args` is a rest parameter. The rest parameter\'s value is an array containing all remaining arguments, **and can only be the last parameter**! In this example, the rest parameter was the second parameter. This is not possible, and will throw a syntax error. @@ -5541,7 +5541,7 @@ console.log(nums(4, 2)); console.log(nums(1, 2)); ``` -
Answer +
Answer In JavaScript, we don\'t _have_ to write the semicolon (`;`) explicitly, however the JavaScript engine still adds them after statements. This is called **Automatic Semicolon Insertion**. A statement can for example be variables, or keywords like `throw`, `return`, `break`, etc. @@ -5579,7 +5579,7 @@ const member = new Person(); console.log(member.name); ``` -
Answer +
Answer We can set classes equal to other classes/function constructors. In this case, we set `Person` equal to `AnotherPerson`. The name on this constructor is `Sarah`, so the name property on the new `Person` instance `member` is `"Sarah"`. @@ -5600,7 +5600,7 @@ console.log(info); console.log(Object.keys(info)); ``` -
Answer +
Answer A Symbol is not _enumerable_. The Object.keys method returns all _enumerable_ key properties on an object. The Symbol won\'t be visible, and an empty array is returned. When logging the entire object, all properties will be visible, even non-enumerable ones. @@ -5625,7 +5625,7 @@ console.log(getList(list)) console.log(getUser(user)) ``` -
Answer +
Answer The `getList` function receives an array as its argument. Between the parentheses of the `getList` function, we destructure this array right away. You could see this as: @@ -5653,7 +5653,7 @@ const name = "Lydia"; console.log(name()); ``` -
Answer +
Answer The variable `name` holds the value of a string, which is not a function, thus cannot invoke. @@ -5675,7 +5675,7 @@ const output = `${[] && "Im"}possible! You should${"" && `n't`} see a therapist after so much JavaScript lol`; ``` -
Answer +
Answer `[]` is a truthy value. With the `&&` operator, the right-hand value will be returned if the left-hand value is a truthy value. In this case, the left-hand value `[]` is a truthy value, so `"Im'` gets returned. @@ -5697,7 +5697,7 @@ const three = [] || 0 || true; console.log(one, two, three); ``` -
Answer +
Answer With the `||` operator, we can return the first truthy operand. If all values are falsy, the last operand gets returned. @@ -5732,7 +5732,7 @@ firstFunction(); secondFunction(); ``` -
Answer +
Answer With a promise, we basically say _I want to execute this function, but I'll put it aside for now while it\'s running since this might take a while. Only when a certain value is resolved (or rejected), and when the call stack is empty, I want to use this value._ @@ -5764,7 +5764,7 @@ for (let item of set) { } ``` -
Answer +
Answer The `+` operator is not only used for adding numerical values, but we can also use it to concatenate strings. Whenever the JavaScript engine sees that one or more values are not a number, it coerces the number into a string. @@ -5786,7 +5786,7 @@ However, the second one is a string `"Lydia"`. `"Lydia"` is a string and `2` is Promise.resolve(5); ``` -
Answer +
Answer We can pass any type of value we want to `Promise.resolve`, either a promise or a non-promise. The method itself returns a promise with the resolved value. If you pass a regular function, it'll be a resolved promise with a regular value. If you pass a promise, it'll be a resolved promise with the resolved value of that passed promise. @@ -5814,7 +5814,7 @@ const person = { name: "Lydia" }; compareMembers(person); ``` -
Answer +
Answer Objects are passed by reference. When we check objects for strict equality (`===`), we\'re comparing their references. @@ -5846,7 +5846,7 @@ const colors = ["pink", "red", "blue"]; console.log(colorConfig.colors[1]); ``` -
Answer +
Answer In JavaScript, we have two ways to access properties on an object: bracket notation, or dot notation. In this example, we use dot notation (`colorConfig.colors`) instead of bracket notation (`colorConfig["colors"]`). @@ -5873,7 +5873,7 @@ function getName() { getName(); ``` -
Answer +
Answer Each function has its own _execution context_ (or _scope_). The `getName` function first looks within its own context (scope) to see if it contains the variable `name` we\'re trying to access. In this case, the `getName` function contains its own `name` variable: we declare the variable `name` with the `let` keyword, and with the value of `'sarah'`. @@ -5915,7 +5915,7 @@ console.log(one.next().value); console.log(two.next().value); ``` -
Answer +
Answer With the `yield` keyword, we `yield` values in a generator function. With the `yield*` keyword, we can yield values from another generator function, or iterable object (for example an array). @@ -5947,7 +5947,7 @@ console.log(two.next().value); // undefined console.log(`${((x) => x)("I love")} to program`); ``` -
Answer +
Answer Expressions within template literals are evaluated first. This means that the string will contain the returned value of the expression, the immediately invoked function `(x => x)('I love')` in this case. We pass the value `'I love'` as an argument to the `x => x` arrow function. `x` is equal to `'I love'`, which gets returned. This results in `I love to program`. @@ -5969,7 +5969,7 @@ let config = { config = null; ``` -
Answer +
Answer Normally when we set objects equal to `null`, those objects get _garbage collected_ as there is no reference anymore to that object. However, since the callback function within `setInterval` is an arrow function (thus bound to the `config` object), the callback function still holds a reference to the `config` object. As long as there is a reference, the object won\'t get garbage collected. Since it\'s not garbage collected, the `setInterval` callback function will still get invoked every 1000ms (1s). @@ -5995,7 +5995,7 @@ myMap.get(myFunc); myMap.get(() => "greeting"); ``` -
Answer +
Answer When adding a key/value pair using the `set` method, the key will be the value of the first argument passed to the `set` function, and the value will be the second argument passed to the `set` function. The key is the _function_ `() => 'greeting'` in this case, and the value `'Hello world'`. `myMap` is now `{ () => 'greeting' => 'Hello world!' }`. @@ -6028,7 +6028,7 @@ changeAgeAndName(); console.log(person); ``` -
Answer +
Answer Both the `changeAge` and `changeAgeAndName` functions have a default parameter, namely a _newly_ created object `{ ...person }`. This object has copies of all the key/values in the `person` object. From 791cc477cdceda354f6ea66c3cf2fe9e76f16153 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Fri, 18 Nov 2022 08:31:10 +0530 Subject: [PATCH 082/117] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 805862f..434e35f 100644 --- a/README.md +++ b/README.md @@ -3657,8 +3657,8 @@ During the **capturing** phase, the event goes through the ancestor elements dow ## Q. All object have prototypes? -- A: true -- B: false +- [ ] `true` +- [ ] `false`
Answer From 30a3d8a9a650aacc059d5977b486b83ce5ba9c25 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sat, 19 Nov 2022 15:53:51 +0530 Subject: [PATCH 083/117] Captcha Generator --- assets/captcha.png | Bin 0 -> 100287 bytes program-writing.md | 23 ++++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 assets/captcha.png diff --git a/assets/captcha.png b/assets/captcha.png new file mode 100644 index 0000000000000000000000000000000000000000..37b314377df7d755758873af62ba072b176b45b7 GIT binary patch literal 100287 zcmYIvWmKHK);12sy*RWKC~n2QP}~Z|ixqb$Hs~M)iWhe)#a)WKySokyZZo*gd_3p8 z&-s32-78tiPWHaDEx8h|t}2IvNr8!gfPkYQFQb8gfVlBeXfe=US|BV%GcO-RR}Hz3 z2$d65hc6WrD=8Hz1caJctS3{{m-;Jbc|BJI1VXoe3gU((EdT)lUZ5Z&^#x#b@{FEA zwdl@{4FsP0Z}wv9l^QSQu#Mmh_>Re4p?tY%Ow~5b{)0L*hym zJvKO=!^W7dM_q0sz7us1;MFoTbng-Of&5)8(VT~OKB5U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c>S)p@pqT`AEQp}3Z0V(+g`A}*1(Fliz_=f z;gu!~AnlgbNu|Z3e5ytC*JNOf#!I42G{~l8@rC_`x#X#lV_X3y{tkC|7qO1Wcr40? z2ANYw)mSC}acpFdv6E;>kZ3rz9pG_#`xaogKvo+R6cH$W8S>ZA__aCu3n=R;jiv*rS5t`wSNQWCqN00eFDevD?UIBciLs9*$QOVrt0smxH;PXSri%* zeoiDk^FL)mQEa!8QbKtpDbV(uZJ1Sd*)Iif5p8xo{kpy*LC@Y$T9nS{(CZ=8Uv61 z`%wt9=g;3I0GNsm$BgCv)BDJlf~GKRGlp*d(2589uYBLBLI3&4)}Kki|65iJ*86`V e!2sIpyWFp=Uni(i5AR_v83_gP|7+`<5}E)KKlOb8 literal 0 HcmV?d00001 diff --git a/program-writing.md b/program-writing.md index a37ed51..8b13d05 100644 --- a/program-writing.md +++ b/program-writing.md @@ -147,6 +147,14 @@ console.log(dif1); // => [1, 2, 6] ## Q. Validate file size and extension before file upload in JavaScript? +```js +Output: + +File Name: pic.jpg +File Size: 1159168 bytes +File Extension: jpg +``` +
Answer ```html @@ -194,19 +202,28 @@ File Extension: jpg ## Q. Create a captcha using javascript? +

+ Captcha in JavaScript +

+
Answer ```html - JavaScript Captcha Example + JavaScript Captcha Generator From 0e1376bf91d6a2a817ce56b5017296c25d34b6af Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 20 Nov 2022 10:36:14 +0530 Subject: [PATCH 084/117] Update program-writing.md --- program-writing.md | 57 +++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/program-writing.md b/program-writing.md index 8b13d05..e60e6be 100644 --- a/program-writing.md +++ b/program-writing.md @@ -160,36 +160,37 @@ File Extension: jpg ```html - - JavaScript File Upload Example - - - - -
- - - - - + + + + + +
+ +

+ + +
+ + ``` **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-cp-file-upload-fj17kh?file=/index.html)** From 1f365d257e5e79b47e27656028a5b302af7bc521 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 20 Nov 2022 12:38:14 +0530 Subject: [PATCH 085/117] stopwatch --- assets/stop-watch.png | Bin 0 -> 23552 bytes program-writing.md | 6 +++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 assets/stop-watch.png diff --git a/assets/stop-watch.png b/assets/stop-watch.png new file mode 100644 index 0000000000000000000000000000000000000000..de237a7ae257629e6712a50bf745f8d7978b3687 GIT binary patch literal 23552 zcmd>lWmua_&^GR_!M#v4SaEk~p%iy_cZcHcEl}J_aW8Jcf@^ViclS3v=e+Ol@BepQ z*(CcUGdnwT&+a_4^F)4DltD)!MuCEYLYI@3`~n391Au(rLPCJNgB9(zARo{!Uu49g zD#u6f@3(;3~ z?|Y*Y4*0-r&gqga!*-E>@Lg-haS<$u|l;Qa{J zD6CRh%8-`VHNFDA`<=(JuOlO}1A7-|4#=OHJ?sU>{nqYQOAw@#@gOhEEf)|23(Jfp z7jdk#%HXDz?>m4yMSsTo_wOhFUMm{vue|l*P>MnclP-Wx+^+&z5aP^A#h9=?q7PD!qrpC8_X;dIIy(?R@E!IO} zM6JXpjPBeyG^$O81K}JZO>Q7fLPvl9SBqEkFp7Z8?VTN~e{^?XtWkHoS$g{;U=K2u zmdhv5`uvPFL`2`X^Z6j7yLaw28OS!}6#a|@v!TYX878cft@9Pkt;?MO2LDW49-BKyTaard4a&k(+FTirP`hI)k%1uRPUF0xk z+E#e0e)|oVWA$u3XJ_ZXQz*FbKDM6N>aFZ|I=0Ry64(I3OZcZ>gjn870+%C0kwTyA zlToxH+);In8*%tN&Q|?QPnVnj%1#_RZmbbaj^9cQt|^N&FQ+!fM}N?J9c7p5*@H}d zceV)^waifSr?~NVRIOZh)EtvW>bknRm3K@`3jfgO^i>ixN9);b&CiHMs)-h6N7>4* z_OHwAEJWn@Fb2f_lE5LSyW*P^TNQF2R>Wn?SV>#2s?a2~r@{b=S|7ai-Tq&(( zQsIEpsy)C?*UL!q#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6dq(sf!0)`1aeINcYoawdAyOgC+wY_a|TGSk$?RUZrb~|IYKJM&i YydL^9na{@(sNH+aPFSJK4V{Sp1s4bQGXMYp literal 0 HcmV?d00001 diff --git a/program-writing.md b/program-writing.md index e60e6be..d5b4919 100644 --- a/program-writing.md +++ b/program-writing.md @@ -204,7 +204,7 @@ File Extension: jpg ## Q. Create a captcha using javascript?

- Captcha in JavaScript + Captcha in JavaScript

Answer @@ -246,6 +246,10 @@ File Extension: jpg ## Q. Create a stopwatch in javascript? +

+ Stop Watch in JavaScript +

+
Answer ```html From 89fe193c82e21e75e97a03ac9122216304951374 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 20 Nov 2022 12:42:03 +0530 Subject: [PATCH 086/117] Update captcha.png --- assets/captcha.png | Bin 100287 -> 128323 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/captcha.png b/assets/captcha.png index 37b314377df7d755758873af62ba072b176b45b7..daa3397cd84da320b6e14594acaed188f6d34a16 100644 GIT binary patch literal 128323 zcmeFYhf|YXw?0f0M5=%k1tOw=k93q?R8&+DM3f@EiAa|gN)qYPf(p_Eq98>)w5>xz@T8ADbHSoH>7niHV8l!Tmc= zn3!1NnV6WXZ$e-J~6t@R5>iZ&bVOnxb^536H|2>7uER`G&-%TYCBuZMW_GW)sVpqGXaY&O}F?P z5!-#v0v2j&p*POC78RfZjW=>K@2Qm&hr4G;v(q-76O+$GM#5mLi!5(s|L2LmM7Q#6TzHXQA07i}y8G zp#!mdG?w%usjvSL+V~Ayrd43ncdedVkm%%8CX{h2nH--u?Kn#KQ#!I*k>IYRDVlVq zjaV3;_5pZzh3)ji2mg_LvqQJDw=o_K3T-DfPvm51Fb6P%UgL_2V~QS?X6FLeS_a0$+R|83e=NjuE) zbCm5;sJlU%BUb(}yyGxB3cacLl1wU#$y3*-w{Qdm*0uNBACL3Kn`_CMj*r@twTL5MkqXJgG=RW$1<#CH_|t*Tn$CKQBU4 zH0&k_NeQPD_$0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pDbV(uZJ1Sd*)Iif5p8xo{kpy*LC@Y$T9nS{(CZ=8Uv61 z`%wt9=g;3I0GNsm$BgCv)BDJlf~GKRGlp*d(2589uYBLBLI3&4)}Kki|65iJ*86`V e!2sIpyWFp=Uni(i5AR_v83_gP|7+`<5}E)KKlOb8 From 37f3e6f5704864af4ec2a5abc6bb8316234d71fd Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 20 Nov 2022 12:49:15 +0530 Subject: [PATCH 087/117] Update program-writing.md --- program-writing.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/program-writing.md b/program-writing.md index d5b4919..e4583db 100644 --- a/program-writing.md +++ b/program-writing.md @@ -334,6 +334,11 @@ File Extension: jpg ## Q. Write a program to reverse a string? +```js +Input: Hello +Output: olleH +``` +
Answer ```javascript From 58bbfc1e98c34fa858389a40efcf4d745c184d93 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 20 Nov 2022 12:59:11 +0530 Subject: [PATCH 088/117] Update program-writing.md --- program-writing.md | 105 ++++++++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 54 deletions(-) diff --git a/program-writing.md b/program-writing.md index e4583db..01e60d1 100644 --- a/program-writing.md +++ b/program-writing.md @@ -360,6 +360,35 @@ console.log(reverseString("Hello")); ↥ back to top +## Q. Given a string, reverse each word in the sentence + +**Example:** + +```js +Input: "Hello World"; +Output: "olleH dlroW"; +``` + +
Answer + +```js +const str = "Hello World"; + +let reverseEntireSentence = reverseBySeparator(str, ""); + +console.log(reverseBySeparator(reverseEntireSentence, " ")); + +function reverseBySeparator(string, separator) { + return string.split(separator).reverse().join(separator); +} +``` + +
+ + + ## Q. Create a Promise to accept car names as argument and send response once the argument matches with Maruti?
Answer @@ -406,40 +435,37 @@ const address = { Output: // Now person should have 5 properties -name, age, addressLine1, addressLine2, city +{ + name: "Tanvi", + age: 28, + addressLine1: "Some Location x", + addressLine2: "Some Location y", + city: "Bangalore" +} ```
Answer -Write merge function which will take two object and add all the own property of second object into first object. - -**Method 1: Using ES6, Object.assign method:** - ```js -const merge = (toObj, fromObj) => Object.assign(toObj, fromObj); +/** + * Using Spread Object + */ -console.log(merge(person, address)); -// {name: "Tanvi", age: 28, addressLine1: "Some Location x", addressLine2: "Some Location y", city: "Bangalore"} -``` +const person = { + name: "Tanvi", + age: 28 +}; -**Method 2: Without using built-in function:** +const address = { + addressLine1: "Some Location x", + addressLine2: "Some Location y", + city: "Bangalore" +}; -```js -function mergeObject(toObj, fromObj) { - // Make sure both of the parameter is an object - if (typeof toObj === "object" && typeof fromObj === "object") { - for (var pro in fromObj) { - // Assign only own properties not inherited properties - if (fromObj.hasOwnProperty(pro)) { - toObj[pro] = fromObj[pro]; - } - } - } else { - throw "Merge function can apply only on object"; - } -} -console.log(mergeObject(person, address)); +const merged = {...person, ...address}; + +console.log(merged); // {name: "Tanvi", age: 28, addressLine1: "Some Location x", addressLine2: "Some Location y", city: "Bangalore"} ``` @@ -541,35 +567,6 @@ removeDups(names); // // 'John', 'Paul', 'George', 'Ringo' ↥ back to top -## Q. Given a string, reverse each word in the sentence - -**Example:** - -```js -Input: "Hello World"; -Output: "olleH dlroW"; -``` - -
Answer - -```js -const str = "Hello World"; - -let reverseEntireSentence = reverseBySeparator(str, ""); - -console.log(reverseBySeparator(reverseEntireSentence, " ")); - -function reverseBySeparator(string, separator) { - return string.split(separator).reverse().join(separator); -} -``` - -
- - - ## Q. Use a closure to create a private counter? **Example:** From 012f1e4bb9fc87e32ea56fca3ecef9258001e3aa Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 20 Nov 2022 17:04:49 +0530 Subject: [PATCH 089/117] Update program-writing.md --- program-writing.md | 786 ++++++++++++++++++++++----------------------- 1 file changed, 382 insertions(+), 404 deletions(-) diff --git a/program-writing.md b/program-writing.md index 01e60d1..1943861 100644 --- a/program-writing.md +++ b/program-writing.md @@ -7,7 +7,7 @@ **Examples:** ```js -const arry = [ +[ { Phase: "Phase 1", Step: "Step 1", Task: "Task 1", Value: "5"}, { Phase: "Phase 1", Step: "Step 1", Task: "Task 2", Value: "10"}, { Phase: "Phase 1", Step: "Step 2", Task: "Task 1", Value: "15"}, @@ -16,7 +16,7 @@ const arry = [ { Phase: "Phase 2", Step: "Step 1", Task: "Task 2", Value: "30"} ]; -// Output: +// Output: Group By 'Phase' { 'Phase 1': [ { Phase: 'Phase 1', Step: 'Step 1', Task: 'Task 1', Value: '5' }, @@ -95,8 +95,8 @@ console.log(sum(10)(20)); ```js Input: -const a1 = ['a', 'b']; -const a2 = ['a', 'b', 'c', 'd']; +['a', 'b']; +['a', 'b', 'c', 'd']; Output: ["c", "d"] @@ -389,21 +389,28 @@ function reverseBySeparator(string, separator) { ↥ back to top -## Q. Create a Promise to accept car names as argument and send response once the argument matches with Maruti? +## Q. Create a Promise to accept argument and make it resolve if the argument matches with predefined condition? + +```js +Input: ['Maruti Suzuki', 'Hyundai', 'Tata Motors', 'Kia', 'Mahindra & Mahindra']; +Key: Maruti Suzuki +Output: +Maruti Suzuki +```
Answer ```js async function myCars(name) { const promise = new Promise((resolve, reject) => { - name === "Maruti" ? resolve(name) : reject(name); + name === "Maruti Suzuki" ? resolve(name) : reject(name); }); const result = await promise; console.log(result); // "resolved!" } -myCars("Maruti"); +myCars("Maruti Suzuki"); ``` **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-promise-1tmrnp?file=/src/index.js)** @@ -421,12 +428,12 @@ myCars("Maruti"); ```js Input: -const person = { +{ name: "Tanvi", age: 28 }; -const address = { +{ addressLine1: "Some Location x", addressLine2: "Some Location y", city: "Bangalore" @@ -523,6 +530,11 @@ function findMissingNumber(arrayOfIntegers, upperBound, lowerBound) { ## Q. Write a function to remove duplicates from an array in JavaScript? +```js +Input: ['John', 'Paul', 'George', 'Ringo', 'John'] +Output: ['John', 'Paul', 'George', 'Ringo'] +``` +
Answer **1. Using set():** @@ -558,7 +570,7 @@ function removeDups(names) { return Object.keys(unique); } -removeDups(names); // // 'John', 'Paul', 'George', 'Ringo' +removeDups(names); // 'John', 'Paul', 'George', 'Ringo' ```
@@ -738,7 +750,7 @@ You can create a function which uses chain of string methods such as charAt, toU ```js function capitalizeFirstLetter(string) { let arr = string.split(" "); - for (var i = 0; i < arr.length; i++) { + for (let i = 0; i < arr.length; i++) { arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1); } return arr.join(" "); @@ -784,8 +796,8 @@ function check(str) { } } -var ltrlStr = "Hi I am string literal"; -var objStr = new String("Hi I am string object"); +const ltrlStr = "Hi I am string literal"; +const objStr = new String("Hi I am string object"); console.log(check(ltrlStr)); // It is a string literal console.log(check(objStr)); // It is an object of string @@ -799,18 +811,22 @@ console.log(check(objStr)); // It is an object of string ↥ back to top -## Q. How do you reversing an array? +## Q. Write a program to reverse an array? + +```js +Input: ["Apple", "Banana", "Mango", "Orange"]; +Output: ["Orange", "Mango", "Banana", "Apple"]; +```
Answer -You can use reverse() method is used reverse the elements in an array. This method is useful to sort an array in descending order. Let us see the usage of reverse() method in an example, +You can use reverse() method is used reverse the elements in an array. This method is useful to sort an array in descending order. ```js const fruits = ["Apple", "Banana", "Mango", "Orange"]; const reversed = fruits.reverse(); -console.log('reversed:', reversed); -// expected output: "reversed:" Array ["Orange", "Mango", "Banana", "Apple"] +console.log(reversed); // ["Orange", "Mango", "Banana", "Apple"] ```
@@ -819,7 +835,7 @@ console.log('reversed:', reversed); ↥ back to top -## Q. How do you find min and max value in an array? +## Q. Write a program to find min and max value in an array? **Example:** @@ -832,11 +848,10 @@ Max: 70
Answer -You can use `Math.min` and `Math.max` methods on array variable to find the minimum and maximum elements with in an array. -Let us create two functions to find the min and max value with in an array, +You can use `Math.min` and `Math.max` methods on array variable to find the minimum and maximum elements with in an array. ```js -var marks = [50, 20, 70, 60, 45, 30]; +const marks = [50, 20, 70, 60, 45, 30]; function findMin(arr) { return Math.min.apply(null, arr); @@ -845,8 +860,8 @@ function findMax(arr) { return Math.max.apply(null, arr); } -console.log(findMin(marks)); -console.log(findMax(marks)); +console.log(findMin(marks)); // 20 +console.log(findMax(marks)); // 70 ```
@@ -855,18 +870,27 @@ console.log(findMax(marks)); ↥ back to top -## Q. How do you find min and max values without Math functions? +## Q. Write a program to find min and max values in an array without using Math functions? + +**Example:** + +```js +Input: [50, 20, 70, 60, 45, 30]; +Output: +Min: 20 +Max: 70 +```
Answer You can write functions which loops through an array comparing each value with the lowest value or highest value to find the min and max values. Let us create those functions to find min an max values, ```js -var marks = [50, 20, 70, 60, 45, 30]; +const marks = [50, 20, 70, 60, 45, 30]; function findMin(arr) { - var length = arr.length; - var min = Infinity; + let length = arr.length; + let min = Infinity; while (length--) { if (arr[length] < min) { min = arr[length]; @@ -876,8 +900,8 @@ function findMin(arr) { } function findMax(arr) { - var length = arr.length; - var max = -Infinity; + let length = arr.length; + let max = -Infinity; while (length--) { if (arr[length] > max) { max = arr[length]; @@ -886,8 +910,8 @@ function findMax(arr) { return max; } -console.log(findMin(marks)); -console.log(findMax(marks)); +console.log(findMin(marks)); // 20 +console.log(findMax(marks)); // 70 ```
@@ -898,6 +922,14 @@ console.log(findMax(marks)); ## Q. Check if object is empty or not using javaScript? +**Example:** + +```js +Input: +const obj = {}; +console.log(isEmpty(obj)); // true +``` +
Answer ```javascript @@ -919,6 +951,13 @@ console.log(isEmpty(obj)); ## Q. Write a function to validate an email using regular expression? +**Example:** + +```js +Input: 'pradeep.vwa@gmail.com' +Output: true +``` +
Answer ```javascript @@ -940,6 +979,13 @@ console.log(validateEmail("pradeep.vwa@gmail.com")); // true ## Q. Use RegEx to test password strength in JavaScript? +**Example:** + +```js +Input: 'Pq5*@a{J' +Output: 'PASS' +``` +
Answer ```javascript @@ -975,22 +1021,34 @@ PASS ↥ back to top -## Q. Write a script that returns the number of occurrences of character given a string as input +## Q. Write a program to count the number of occurrences of character given a string as input? + +**Example:** + +```js +Input: 'Hello' +Output: +h: 1 +e: 1 +l: 2 +o: 1 +```
Answer ```javascript function countCharacters(str) { - return str.replace(/ /g, "").toLowerCase().split("").reduce((p, c) => { - if (c in p) { - p[c]++; + return str.replace(/ /g, "").toLowerCase().split("").reduce((result, key) => { + if (key in result) { + result[key]++; } else { - p[c] = 1; + result[key] = 1; } - return p; + return result; }, {}); } -console.log(countCharacters("the brown fox jumps over the lazy dog")); + +console.log(countCharacters("Hello")); ```
@@ -1001,6 +1059,14 @@ console.log(countCharacters("the brown fox jumps over the lazy dog")); ## Q. Write a function that return the number of occurrences of a character in paragraph? +**Example:** + +```js +Input: 'the brown fox jumps over the lazy dog' +Key: 'o' +Output: 4 +``` +
Answer ```javascript @@ -1027,9 +1093,17 @@ console.log(charCount("the brown fox jumps over the lazy dog", "o")); ## Q. Write a recursive and non-recursive Factorial function? +**Example:** + +```js +Input: 5 +Output: 120 +``` +
Answer ```javascript +// Recursive Method function recursiveFactorial(n) { if (n < 1) { throw Error("Value of N has to be greater then 1"); @@ -1043,6 +1117,7 @@ function recursiveFactorial(n) { console.log(recursiveFactorial(5)); +// Non-Recursive Method function factorial(n) { if (n < 1) { throw Error("Value of N has to be greater then 1"); @@ -1068,11 +1143,18 @@ console.log(factorial(5)); ## Q. Write a recursive and non recursive fibonacci-sequence? +**Example:** + +```js +Input: 8 +Output: 34 +``` +
Answer ```javascript // 1, 1, 2, 3, 5, 8, 13, 21, 34 - +// Recursive Method function recursiveFibonacci(num) { if (num <= 1) { return 1; @@ -1083,10 +1165,9 @@ function recursiveFibonacci(num) { console.log(recursiveFibonacci(8)); +// Non-Recursive Method function fibonnaci(num) { - let a = 1, - b = 0, - temp; + let a = 1, b = 0, temp; while (num >= 0) { temp = a; a = a + b; @@ -1098,8 +1179,7 @@ function fibonnaci(num) { console.log(fibonnaci(7)); -// Memoization fibonnaci - +// Memoization Method function fibonnaci(num, memo = {}) { if (num in memo) { return memo[num]; @@ -1155,8 +1235,8 @@ console.log(reverse(12345)); **Example:** ```js -Input: {10, 20, 30, 40, 50} -Output: {50, 40, 30, 20, 10} +Input: [10, 20, 30, 40, 50] +Output: [50, 40, 30, 20, 10] ```
Answer @@ -1182,70 +1262,18 @@ console.log(reverse); ↥ back to top -## Q. Rotate 2D array +## Q. Get top N from array **Example:** ```js -Input: -[1, 2, 3, 4], -[5, 6, 7, 8], -[9, 10, 11, 12] - - -Output: -[1, 5, 9] -[2, 6, 10] -[3, 7, 11] -[4, 8, 12] +Input: [1, 8, 3, 4, 5] +Key: 2 +Output: [5, 8] ```
Answer -```javascript -const transpose = (arr) => arr[0].map((col, i) => arr.map((row) => row[i])); - -console.log( - transpose([ - [1, 2, 3, 4], - [5, 6, 7, 8], - [9, 10, 11, 12], - ]) -); -``` - -
- - - -## Q. Get Column from 2D Array - -
Answer - -```javascript -const getColumn = (arr, n) => arr.map((x) => x[n]); - -const twoDimensionalArray = [ - [1, 2, 3], - [4, 5, 6], - [7, 8, 9], -]; - -console.log(getColumn(twoDimensionalArray, 1)); //Result = [2,5,8] -``` - -
- - - -## Q. Get top N from array - -
Answer - ```javascript function topN(arr, num) { let sorted = arr.sort((a, b) => a - b); @@ -1261,40 +1289,20 @@ console.log(topN([1, 8, 3, 4, 5], 2)); // [5,8] ↥ back to top -## Q. Get query params from Object - -
Answer - -```javascript -function getQueryParams(obj) { - let parms = ""; - for (let key in obj) { - if (obj.hasOwnProperty(key)) { - if (parms.length > 0) { - parms += "&"; - } - parms += encodeURI(`${key}=${obj[key]}`); - } - } - return parms; -} +## Q. Get the consecutive 1\'s in binary? -console.log( - getQueryParams({ - name: "Umesh", - tel: "48289", - add: "3333 emearld st", - }) -); -``` +**Example:** -
+```js +Input: 7 +Output: 3 - +Input: 5 +Output: 1 -## Q. Consecutive 1\'s in binary +Input: 13 +Output: 2 +```
Answer @@ -1302,8 +1310,7 @@ console.log( function consecutiveOne(num) { let binaryArray = num.toString(2); - let maxOccurence = 0, - occurence = 0; + let maxOccurence = 0, occurence = 0; for (let val of binaryArray) { if (val === "1") { occurence += 1; @@ -1314,9 +1321,12 @@ function consecutiveOne(num) { } return maxOccurence; } -//13 = 1101 = 2 -//5 = 101 = 1 -console.log(consecutiveOne(5)); //1 + +console.log(consecutiveOne(7)); // 3 + +// 13 => 1101 = 2 +// 5 => 101 = 1 +// 7 => 111 = 3 ```
@@ -1325,59 +1335,15 @@ console.log(consecutiveOne(5)); //1 ↥ back to top -## Q. Spiral travesal of matrix +## Q. Write a program to merge sorted array and sort it? -
Answer - -```javascript -var input = [ - [1, 2, 3, 4], - [5, 6, 7, 8], - [9, 10, 11, 12], - [13, 14, 15, 16], -]; - -var spiralTraversal = function (matriks) { - let result = []; - var goAround = function (matrix) { - if (matrix.length === 0) { - return; - } - - // right - result = result.concat(matrix.shift()); - - // down - for (var j = 0; j < matrix.length - 1; j++) { - result.push(matrix[j].pop()); - } - - // bottom - result = result.concat(matrix.pop().reverse()); - - // up - for (var k = matrix.length - 1; k > 0; k--) { - result.push(matrix[k].shift()); - } - - return goAround(matrix); - }; - - goAround(matriks); +**Example:** - return result; -}; -console.log(spiralTraversal(input)); // [1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10] +```js +Input: [1, 2, 3, 4, 5, 6], [0, 3, 4, 7] +Output: [0, 1, 2, 3, 4, 5, 6, 7] ``` -
- - - -## Q. Merge Sorted array and sort it. -
Answer ```javascript @@ -1399,7 +1365,7 @@ console.log(mergeSortedArray([1, 2, 3, 4, 5, 6], [0, 3, 4, 7])); // [0, 1, 2, 3, **Example:** ```js -Input: {"map", "art", "how", "rat", "tar", "who", "pam", "shoop"} +Input: ["map", "art", "how", "rat", "tar", "who", "pam", "shoop"] Output: { @@ -1436,41 +1402,27 @@ console.log(groupAnagram(["map", "art", "how", "rat", "tar", "who", "pam", "shoo ↥ back to top -## Q. Print the largest (maximum) hourglass sum found in 2d array? - -
Answer - -```javascript -// if arr 6 X 6 then iterate it till 4 X 4 [reduce by two] -// if arr 8 X 8 then iterate it till 6 X 6 [reduce by two] -function main(arr) { - let maxScore = -999; - let len = arr.length; - for (let i = 0; i < len - 2; i++) { - for (let j = 0; j < len - 2; j++) { - let total = - arr[i][j] + - arr[i][j + 1] + - arr[i][j + 2] + - arr[i + 1][j + 1] + - arr[i + 2][j] + - arr[i + 2][j + 1] + - arr[i + 2][j + 2]; - - maxScore = Math.max(maxScore, total); - } - } - console.log(maxScore); -} -``` +## Q. Write a program to transform array of objects to array? -
+**Example:** - +```js +Input: +[ + { vid: "aaa", san: 12 }, + { vid: "aaa", san: 18 }, + { vid: "aaa", san: 2 }, + { vid: "bbb", san: 33 }, + { vid: "bbb", san: 44 }, + { vid: "aaa", san: 100 }, +] -## Q. Transform array of object to array +Output: +[ + { vid: 'aaa', san: [ 12, 18, 2, 100 ] }, + { vid: 'bbb', san: [ 33, 44 ] } +] +```
Answer @@ -1491,15 +1443,6 @@ let newData = data.reduce((acc, item) => { }, {}); console.log(Object.keys(newData).map((key) => newData[key])); - -// Result -// [[object Object] { -// san: [12, 18, 2, 100], -// vid: "aaa" -// }, [object Object] { -// san: [33, 44], -// vid: "bbb" -// }] ```
@@ -1508,7 +1451,7 @@ console.log(Object.keys(newData).map((key) => newData[key])); ↥ back to top -## Q. Create a private variable or private method in object +## Q. Create a private variable or private method in object?
Answer @@ -1537,7 +1480,15 @@ obj.callPrivateFunction(); // this is private function ↥ back to top -## Q. Flatten only Array not objects +## Q. Write a program to flatten only Array not objects? + +**Example:** + +```js +Input: [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; + +Output: [1, { a: [2, [3]]}, 4, 5, 6, 7, "hi", 8, 9, 10] +```
Answer @@ -1554,40 +1505,8 @@ function flatten(arr, result = []) { } let input = [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; -console.log(flatten(input)); // [1, { a: [2, [3]]}, 4, 5, 6, 7, "hi", 8, 9, 10] -function flattenIterative(out) { - // iteratively - let result = out; - while (result.some(Array.isArray)) { - result = [].concat.apply([], result); - } - return result; -} -var list1 = [ - [0, 1], - [2, 3], - [4, 5], -]; -console.log(flattenIterative(list1)); // [0, 1, 2, 3, 4, 5] - -function flattenIterative1(current) { - let result = []; - while (current.length) { - let firstValue = current.shift(); - if (Array.isArray(firstValue)) { - current = firstValue.concat(current); - } else { - result.push(firstValue); - } - } - return result; -} - -let input = [1, { a: [2, [3]] }, 4, [5, [6]], [[7, ["hi"]], 8, 9], 10]; -console.log(flattenIterative1(input)); -var list2 = [0, [1, [2, [3, [4, [5]]]]]]; -console.log(flattenIterative1(list2)); // [0, 1, 2, 3, 4, 5] +console.log(flatten(input)); // [1, { a: [2, [3]]}, 4, 5, 6, 7, "hi", 8, 9, 10] ```
@@ -1596,24 +1515,31 @@ console.log(flattenIterative1(list2)); // [0, 1, 2, 3, 4, 5] ↥ back to top -## Q. Find max difference between two number in Array? +## Q. Find max difference between two numbers in Array? + +**Example:** + +```js +Input: [ -10, 4, -9, -5 ]; +Output: -10 - 4 => 14 + +Input: [1, 2, 4] +Ouput: 4 - 1 => 3 +```
Answer ```javascript function maxDifference(arr) { - let maxDiff = 0; + // find the minimum and the maximum element + let max = Math.max(...arr); + let min = Math.min(...arr); - for (let i = 0; i < arr.length; i++) { - for (let j = i + 1; j < arr.length; j++) { - let diff = Math.abs(arr[i] - arr[j]); - maxDiff = Math.max(maxDiff, diff); - } - } - return maxDiff; + return Math.abs(max - min); } -console.log(maxDifference([1, 2, 4])); // [1 - 4 ] = 3 +const arr = [1, 2, 4]; +console.log(maxDifference(arr)); // 4 - 1 => 3 ```
@@ -1624,6 +1550,16 @@ console.log(maxDifference([1, 2, 4])); // [1 - 4 ] = 3 ## Q. Panagram ? it means all the 26 letters of alphabet are there +**Example:** + +```js +Input: 'We promptly judged antique ivory buckles for the next prize' +Output: 'Pangram' + +Input: 'We promptly judged antique ivory buckles for the prize' +Ouput: 'Not Pangram' +``` +
Answer ```javascript @@ -1644,10 +1580,11 @@ function panagram(input) { } return prev; }, {}); - console.log(Object.keys(obj).length === 26 ? "panagram" : "not pangram"); + console.log(Object.keys(obj).length === 26 ? "Panagram" : "Not Pangram"); } -processData("We promptly judged antique ivory buckles for the next prize"); // pangram -processData("We promptly judged antique ivory buckles for the prize"); // Not Pangram + +panagram("We promptly judged antique ivory buckles for the next prize"); // Pangram +panagram("We promptly judged antique ivory buckles for the prize"); // Not Pangram ```
@@ -1656,74 +1593,45 @@ processData("We promptly judged antique ivory buckles for the prize"); // Not Pa ↥ back to top -## Q. Given two identical DOM trees (not the same one), and a node from one of them find the node in the other one. - -
Answer - -```javascript -function indexOf(arrLike, target) { - return Array.prototype.indexOf.call(arrLike, target); -} - -// Given a node and a tree, extract the nodes path -function getPath(root, target) { - var current = target; - var path = []; - while (current !== root) { - let parentNode = current.parentNode; - path.unshift(indexOf(parentNode.childNodes, current)); - current = parentNode; - } - return path; -} +## Q. Write a program to convert a number into a Roman Numeral? -// Given a tree and a path, let\'s locate a node -function locateNodeFromPath(node, path) { - return path.reduce((root, index) => root.childNodes[index], node); -} +**Example:** -const rootA = document.querySelector("#root-a"); -const rootB = document.querySelector("#root-b"); -const target = rootA.querySelector(".person__age"); +```js +Input: 3 +Output: III -console.log(locateNodeFromPath(rootB, getPath(rootA, target))); +Input: 10 +Output: X ``` -
- - - -## Q. Convert a number into a Roman Numeral -
Answer ```javascript function romanize(num) { let lookup = { - M: 1000, - CM: 900, - D: 500, - CD: 400, - C: 100, - XC: 90, - L: 50, - XL: 40, - X: 10, - IX: 9, - V: 5, - IV: 4, - I: 1, - }, - roman = ""; + M: 1000, + CM: 900, + D: 500, + CD: 400, + C: 100, + XC: 90, + L: 50, + XL: 40, + X: 10, + IX: 9, + V: 5, + IV: 4, + I: 1, + }; + let result = ""; for (let i in lookup) { while (num >= lookup[i]) { - roman += i; + result += i; num -= lookup[i]; } } - return roman; + return result; } console.log(romanize(3)); // III @@ -1735,7 +1643,17 @@ console.log(romanize(3)); // III ↥ back to top -## Q. check if parenthesis is malformed or not +## Q. Write a program to check if parenthesis is malformed or not? + +**Example:** + +```js +Input: "}{{}}" +Output: false + +Input: "{{[]}}" +Output: true +```
Answer @@ -1749,7 +1667,7 @@ function matchParenthesis(str) { result.push(s); } else { if (result.length > 0) { - let lastValue = result.pop(); //pop the last value and compare with key + let lastValue = result.pop(); // pop the last value and compare with key if (obj[lastValue] !== s) { // if it is not same then it is not formated properly return false; @@ -1762,7 +1680,8 @@ function matchParenthesis(str) { return result.length === 0; } -console.log(matchParenthesis("}{{}}"), matchParenthesis("{{[]}}")); // false - true +console.log(matchParenthesis("}{{}}")); // false +console.log(matchParenthesis("{{[]}}")); // true ```
@@ -1771,7 +1690,15 @@ console.log(matchParenthesis("}{{}}"), matchParenthesis("{{[]}}")); // false - t ↥ back to top -## Q. Create Custom Event Emitter class +## Q. Create Custom Event Emitter class? + +**Example:** + +```js +Output: +'Custom event called with argument: a,b,[object Object]' +'Custom event called without argument' +```
Answer @@ -1797,14 +1724,14 @@ class EventEmitter { } let e = new EventEmitter(); -e.on("callme", function (args) { - console.log(`you called me ${args}`); +e.on("myCustomEvent", function (args) { + console.log(`Custom event called with arguments: ${args}`); }); -e.on("callme", function (args) { - console.log(`testing`); +e.on("myCustomEvent", function () { + console.log(`Custom event called without argument`); }); -e.emit("callme", ["a", "b"], { firstName: "umesh", lastName: "gohil" }); +e.emit("myCustomEvent", ["a", "b"], { firstName: "Umesh", lastName: "Gohil" }); ```
@@ -1813,13 +1740,13 @@ e.emit("callme", ["a", "b"], { firstName: "umesh", lastName: "gohil" }); ↥ back to top -## Q. Move all zero\'s to end? +## Q. Wirte a program to move all zero to end? **Example:** ```js -Input: {1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0} -Output:{1, 8, 2, 3, 4, 5, 0, 0, 0, 0, 0} +Input: [1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0] +Output: [1, 8, 2, 3, 4, 5, 0, 0, 0, 0, 0] ```
Answer @@ -1848,6 +1775,21 @@ console.log(moveZeroToEnd([1, 8, 2, 0, 0, 0, 3, 4, 0, 5, 0])); ## Q. Decode message in matrix [diagional down right, diagional up right] +**Example:** + +```js +Input: +[ + ["I", "B", "C", "A", "L", "K", "A"], + ["D", "R", "F", "C", "A", "E", "A"], + ["G", "H", "O", "E", "L", "A", "D"], + ["G", "H", "O", "E", "L", "A", "D"], +] + +Output: +'IROELEA' +``` +
Answer ```javascript @@ -1890,7 +1832,7 @@ let mat = [ ["G", "H", "O", "E", "L", "A", "D"], ]; -console.log(decodeMessage(mat)); //IROELEA +console.log(decodeMessage(mat)); // IROELEA ```
@@ -1899,39 +1841,25 @@ console.log(decodeMessage(mat)); //IROELEA ↥ back to top -## Q. find a pair in array, whose sum is equal to given number? +## Q. Find a pair in array, whose sum is equal to given number? -
Answer - -```javascript -const hasPairSum = (arr, sum) => { - if (arr == null && arr.length < 2) { - return false; - } +**Example:** - let left = 0; - let right = arr.length - 1; - let result = false; +```js +Input: [6, 4, 3, 8], Sum = 8 +Output: false - while (left < right && !result) { - let pairSum = arr[left] + arr[right]; - if (pairSum < sum) { - left++; - } else if (pairSum > sum) { - right--; - } else { - result = true; - } - } - return result; -}; +Input: [1, 2, 4, 4], Sum = 8 +Output: true +``` -console.log(hasPairSum([1, 2, 4, 5], 8)); // null -console.log(hasPairSum([1, 2, 4, 4], 8)); // [2,3] +
Answer +```javascript const hasPairSum = (arr, sum) => { let difference = {}; let hasPair = false; + arr.forEach((item) => { let diff = sum - item; if (!difference[diff]) { @@ -1942,10 +1870,9 @@ const hasPairSum = (arr, sum) => { }); return hasPair; }; -console.log(hasPairSum([6, 4, 3, 8], 8)); -// NOTE: if array is not sorted then subtract the value with sum and store in difference -// then see if that value exist in difference then return true. +console.log(hasPairSum([6, 4, 3, 8], 8)); // false +console.log(hasPairSum([1, 2, 4, 4], 8)); // true ```
@@ -1954,7 +1881,17 @@ console.log(hasPairSum([6, 4, 3, 8], 8)); ↥ back to top -## Q. Binary Search [Array should be sorted] +## Q. Write a Binary Search Program [Array should be sorted]? + +**Example:** + +```js +Input: [-1, 10, 22, 35, 48, 56, 67], key = 22 +Output: 2 + +Input: [-1, 10, 22, 35, 48, 56, 67], key = 27 +Output: -1 +```
Answer @@ -1976,8 +1913,8 @@ function binarySearch(arr, val) { return arr[middleIndex] === val ? middleIndex : -1; } -console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 22)); -console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 27)); +console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 22)); // 2 +console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 27)); // -1 ```
@@ -1988,6 +1925,20 @@ console.log(binarySearch([-1, 10, 22, 35, 48, 56, 67], 27)); ## Q. Write a function to generate Pascal triangle? +**Example:** + +```js +Input: 5 + +Output: +[ 1 ], +[ 1, 1 ], +[ 1, 2, 1 ], +[ 1, 3, 3, 1 ], +[ 1, 4, 6, 4, 1 ], +[ 1, 5, 10, 10, 5, 1 ] +``` +
Answer ```javascript @@ -1995,15 +1946,15 @@ function pascalTriangle(n) { let last = [1], triangle = [last]; for (let i = 0; i < n; i++) { - const ls = [0].concat(last), //[0,1] // [0,1,1] - rs = last.concat([0]); //[1,0] // [1,1,0] - last = rs.map((r, i) => ls[i] + r); //[1, 1] // [1,2,1] - triangle = triangle.concat([last]); // [[1], [1,1]] // [1], [1, 1], [1, 2, 1] + const ls = [0].concat(last), + rs = last.concat([0]); + last = rs.map((r, i) => ls[i] + r); + triangle = triangle.concat([last]); } return triangle; } -console.log(pascalTriangle(2)); +console.log(pascalTriangle(5)); ```
@@ -2014,29 +1965,39 @@ console.log(pascalTriangle(2)); ## Q. Remove array element based on object property? +**Example:** + +```js +Input: +[ + { field: "id", operator: "eq" }, + { field: "cStatus", operator: "eq" }, + { field: "money", operator: "eq" }, +] + +Key: 'money' + +Output: +[ + { field: 'id', operator: 'eq' }, + { field: 'cStatus', operator: 'eq' } +] +``` +
Answer ```javascript -var myArray = [ +let myArray = [ { field: "id", operator: "eq" }, { field: "cStatus", operator: "eq" }, { field: "money", operator: "eq" }, ]; -myArray = myArray.filter(function (obj) { +myArray = myArray.filter((obj) => { return obj.field !== "money"; }); -Console.log(myArray); -``` - -Output - -```js -myArray = [ - {field: "id", operator: "eq"} - {field: "cStatus", operator: "eq"} -] +console.log(myArray); ```
@@ -2052,33 +2013,50 @@ myArray = [ ```js Input: -const data = { - user: { - username: 'Navin Chauhan', - password: 'Secret' - }, - rapot: { - title: 'Storage usage raport', - goal: 'Remove unused data.' - } +{ + user: { + username: 'Navin Chauhan', + password: 'Secret' + }, + rapot: { + title: 'Storage usage raport', + goal: 'Remove unused data.' + } }; +Key: 'user.username' + Output: -console.log(getObjectProperty(data, 'user.username')); // Navin Chauhan +'Navin Chauhan' ```
Answer ```js +const data = { + user: { + username: "Navin Chauhan", + password: "Secret", + }, + rapot: { + title: "Storage usage raport", + goal: "Remove unused data.", + }, +}; + +const path = "user.username"; + const getObjectProperty = (object, path) => { - const parts = path.split('.'); + const parts = path.split("."); for (let i = 0; i < parts.length; ++i) { - const key = parts[i]; - object = object[key]; - } + const key = parts[i]; + object = object[key]; + } return object; }; + +console.log(getObjectProperty(data, path)); ```
From 34be049c2919d43febdc8d5e72afbcc3a5c01e4a Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 20 Nov 2022 19:30:38 +0530 Subject: [PATCH 090/117] Update program-writing.md --- program-writing.md | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/program-writing.md b/program-writing.md index 1943861..888cc0a 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2012,7 +2012,6 @@ console.log(myArray); ```js Input: - { user: { username: 'Navin Chauhan', @@ -2097,6 +2096,47 @@ console.log(count); // {1: 2, 2: 1, 3: 2} ↥ back to top +## Q. Print all pairs with given sum? + +**Example:** + +```js +Input: [1, 5, 7, -1, 5], sum = 6 +Output: (1, 5) (7, -1) (1, 5) + +Input: [2, 5, 17, -1], sum = 7 +Output: (2, 5) +``` + +
Answer + +```js +function getPairs(arr, sum) { + // Consider all possible pairs and check + // their sums + for (let i = 0; i < arr.length; i++) { + for (let j = i + 1; j < arr.length; j++) { + if (arr[i] + arr[j] === sum) { + console.log(arr[i] + ", " + arr[j]); + } + } + } +} + +getPairs([1, 5, 7, -1, 5], 6); + +// Output +// (1, 5) +// (1, 5) +// (7, -1) +``` + +
+ + + ## Q. Improve the below function? ```js From 0629ce5aa1e6725b71275edb2df37a332dead586 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Tue, 22 Nov 2022 08:39:07 +0530 Subject: [PATCH 091/117] Update README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 434e35f..3aa634c 100644 --- a/README.md +++ b/README.md @@ -4766,9 +4766,11 @@ console.log(admin);
Answer -It\'s possible to combine objects using the spread operator `...`. It lets you create copies of the key/value pairs of one object, and add them to another object. In this case, we create copies of the `user` object, and add them to the `admin` object. The `admin` object now contains the copied key/value pairs, which results in `{ admin: true, name: "Lydia", age: 21 }`. +```js +{ admin: true, name: 'Lydia', age: 21 } +``` -<\details> +
↥ back to top From 636c3714577d917a8b8353043d749ccc2bd18d1a Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Tue, 22 Nov 2022 08:49:27 +0530 Subject: [PATCH 092/117] Update README.md --- README.md | 120 +++++++++++++++++++++++++++--------------------------- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/README.md b/README.md index 3aa634c..aa468a8 100644 --- a/README.md +++ b/README.md @@ -3328,7 +3328,7 @@ VM298:6 5 function sayHi() { console.log(name); console.log(age); - var name = "Lydia"; + var name = "Mala Pall"; let age = 21; } @@ -3406,14 +3406,14 @@ There is no value `radius` on that object, which returns `undefined`. ```javascript +true; -!"Lydia"; +!"Mala Pall"; ```
Answer The unary plus tries to convert an operand to a number. `true` is `1`, and `false` is `0`. -The string `'Lydia'` is a truthy value. What we\'re actually asking, is "is this truthy value falsy?". This returns `false`. +The string `'Mala Pall'` is a truthy value. What we\'re actually asking, is "is this truthy value falsy?". This returns `false`.
@@ -3581,7 +3581,7 @@ function Person(firstName, lastName) { this.lastName = lastName; } -const member = new Person("Lydia", "Hallie"); +const member = new Person("Mala Pall", "Hallie"); Person.getFullName = function () { return `${this.firstName} ${this.lastName}`; }; @@ -3615,10 +3615,10 @@ function Person(firstName, lastName) { this.lastName = lastName; } -const lydia = new Person("Lydia", "Hallie"); +const Karthik = new Person("Karthik", "Hallie"); const sarah = Person("Sarah", "Smith"); -console.log(lydia); +console.log(Karthik); console.log(sarah); ``` @@ -3636,10 +3636,10 @@ We said that `this.firstName` equals `"Sarah"` and `this.lastName` equals `"Smit ## Q. What are the three phases of event propagation? -- A: Target > Capturing > Bubbling -- B: Bubbling > Target > Capturing -- C: Target > Bubbling > Capturing -- D: Capturing > Target > Bubbling +- [ ] Target > Capturing > Bubbling +- [ ] Bubbling > Target > Capturing +- [ ] Target > Bubbling > Capturing +- [ ] Capturing > Target > Bubbling
Answer @@ -3732,7 +3732,7 @@ function getPersonInfo(one, two, three) { console.log(three); } -const person = "Lydia"; +const person = "Zoya Babu"; const age = 21; getPersonInfo`${person} is ${age} years old`; @@ -3957,13 +3957,13 @@ The `continue` statement skips an iteration if a certain condition returns `true ## Q. What is the output? ```javascript -String.prototype.giveLydiaPizza = () => { - return "Just give Lydia pizza already!"; +String.prototype.giveRashmi Pizza = () => { + return "Just give Rashmi pizza already!"; }; -const name = "Lydia"; +const name = "Rashmi "; -name.giveLydiaPizza(); +name.giveRashmi Pizza(); ```
Answer @@ -4090,7 +4090,7 @@ If we click `p`, we see two logs: `p` and `div`. During event propagation, there ## Q. What is the output? ```javascript -const person = { name: "Lydia" }; +const person = { name: "Inika " }; function sayHi(age) { console.log(`${this.name} is ${age}`); @@ -4321,7 +4321,7 @@ It returns a unique id. This id can be used to clear that interval with the `cle ## Q. What does this return? ```javascript -[..."Lydia"]; +[..."Inika "]; ```
Answer @@ -4389,7 +4389,7 @@ When we pass multiple promises to the `Promise.race` method, it resolves/rejects ## Q. What is the output? ```javascript -let person = { name: "Lydia" }; +let person = { name: "Inika" }; const members = [person]; person = null; @@ -4422,7 +4422,7 @@ We are only modifying the value of the `person` variable, and not the first elem ```javascript const person = { - name: "Lydia", + name: "Inika", age: 21, }; @@ -4504,7 +4504,7 @@ However, we don\'t return a value. When we don\'t return a value from the functi ```javascript function getInfo(member, year) { - member.name = "Lydia"; + member.name = "Inika"; year = "1998"; } @@ -4522,7 +4522,7 @@ Arguments are passed by _value_, unless their value is an object, then they\'re The variable `birthYear` has a reference to the value `"1997"`. The argument `year` also has a reference to the value `"1997"`, but it\'s not the same value as `birthYear` has a reference to. When we update the value of `year` by setting `year` equal to `"1998"`, we are only updating the value of `year`. `birthYear` is still equal to `"1997"`. -The value of `person` is an object. The argument `member` has a (copied) reference to the _same_ object. When we modify a property of the object `member` has a reference to, the value of `person` will also be modified, since they both have a reference to the same object. `person`\'s `name` property is now equal to the value `"Lydia"` +The value of `person` is an object. The argument `member` has a (copied) reference to the _same_ object. When we modify a property of the object `member` has a reference to, the value of `person` will also be modified, since they both have a reference to the same object. `person`\'s `name` property is now equal to the value `"Inika"`
@@ -4701,7 +4701,7 @@ When we try to increment the value of `myCounter`, it throws an error: `myCounte ## Q. What is the output? ```javascript -const name = "Lydia"; +const name = "Swarna"; age = 21; console.log(delete name); @@ -4758,7 +4758,7 @@ This means that the value of `y` is equal to the first value in the array, which ## Q. What is the output? ```javascript -const user = { name: "Lydia", age: 21 }; +const user = { name: "Swarna", age: 21 }; const admin = { admin: true, ...user }; console.log(admin); @@ -4767,7 +4767,7 @@ console.log(admin);
Answer ```js -{ admin: true, name: 'Lydia', age: 21 } +{ admin: true, name: 'Swarna', age: 21 } ```
@@ -4779,7 +4779,7 @@ console.log(admin); ## Q. What is the output? ```javascript -const person = { name: "Lydia" }; +const person = { name: "Swarna" }; Object.defineProperty(person, "age", { value: 21 }); @@ -4789,11 +4789,13 @@ console.log(Object.keys(person));
Answer +```js With the `defineProperty` method, we can add new properties to an object, or modify existing ones. When we add a property to an object using the `defineProperty` method, they are by default _not enumerable_. The `Object.keys` method returns all _enumerable_ property names from an object, in this case only `"name"`. Properties added using the `defineProperty` method are immutable by default. You can override this behavior using the `writable`, `configurable` and `enumerable` properties. This way, the `defineProperty` method gives you a lot more control over the properties you\'re adding to an object. +``` -<\details> +
↥ back to top @@ -4803,7 +4805,7 @@ Properties added using the `defineProperty` method are immutable by default. You ```javascript const settings = { - username: "lydiahallie", + username: "Akhil Sunderhallie", level: 19, health: 90, }; @@ -5002,14 +5004,14 @@ Every Symbol is entirely unique. The purpose of the argument passed to the Symbo ## Q. What is the output? ```javascript -const name = "Lydia Hallie"; +const name = "Akhil Sunder"; console.log(name.padStart(13)); console.log(name.padStart(2)); ```
Answer -With the `padStart` method, we can add padding to the beginning of a string. The value passed to this method is the _total_ length of the string together with the padding. The string `"Lydia Hallie"` has a length of `12`. `name.padStart(13)` inserts 1 space at the start of the string, because 12 + 1 is 13. +With the `padStart` method, we can add padding to the beginning of a string. The value passed to this method is the _total_ length of the string together with the padding. The string `"Akhil Sunder"` has a length of `12`. `name.padStart(13)` inserts 1 space at the start of the string, because 12 + 1 is 13. If the argument passed to the `padStart` method is smaller than the length of the array, no padding will be added. @@ -5127,14 +5129,14 @@ Since `shape` is frozen, and since the value of `x` is not an object, we cannot ## Q. What is the output? ```javascript -const { name: myName } = { name: "Lydia" }; +const { name: myName } = { name: "Anusha Kapadia" }; console.log(name); ```
Answer -When we unpack the property `name` from the object on the right-hand side, we assign its value `"Lydia"` to a variable with the name `myName`. +When we unpack the property `name` from the object on the right-hand side, we assign its value `"Anusha Kapadia"` to a variable with the name `myName`. With `{ name: myName }`, we tell JavaScript that we want to create a new variable called `myName` with the value of the `name` property on the right-hand side. @@ -5221,9 +5223,9 @@ By default, arguments have the value of `undefined`, unless a value has been pas In ES6, we can overwrite this default `undefined` value with default parameters. For example: -`function sayHi(name = "Lydia") { ... }` +`function sayHi(name = "Akash Guha") { ... }` -In this case, if we didn\'t pass a value or if we passed `undefined`, `name` would always be equal to the string `Lydia` +In this case, if we didn\'t pass a value or if we passed `undefined`, `name` would always be equal to the string `Akash Guha`
@@ -5235,7 +5237,7 @@ In this case, if we didn\'t pass a value or if we passed `undefined`, `name` wou ```javascript const person = { - name: "Lydia", + name: "Rishima Nair", age: 21, }; @@ -5374,7 +5376,7 @@ If you\'re trying to set a default parameter\'s value equal to a parameter which ```javascript // module.js export default () => "Hello world"; -export const name = "Lydia"; +export const name = "Rishima Nair"; // index.js import * as data from "./module"; @@ -5384,7 +5386,7 @@ console.log(data);
Answer -With the `import * as name` syntax, we import _all exports_ from the `module.js` file into the `index.js` file as a new object called `data` is created. In the `module.js` file, there are two exports: the default export, and a named export. The default export is a function which returns the string `"Hello World"`, and the named export is a variable called `name` which has the value of the string `"Lydia"`. +With the `import * as name` syntax, we import _all exports_ from the `module.js` file into the `index.js` file as a new object called `data` is created. In the `module.js` file, there are two exports: the default export, and a named export. The default export is a function which returns the string `"Hello World"`, and the named export is a variable called `name` which has the value of the string `"Rishima Nair"`. The `data` object has a `default` property for the default export, other properties have the names of the named exports and their corresponding values. @@ -5448,20 +5450,20 @@ Then, we try to use the `.push` method on `newList`. Since `newList` is the nume ## Q. What is the output? ```javascript -function giveLydiaPizza() { +function giveSwarnaPizza() { return "Here is pizza!"; } -const giveLydiaChocolate = () => +const giveSwarnaChocolate = () => "Here\'s chocolate... now go hit the gym already."; -console.log(giveLydiaPizza.prototype); -console.log(giveLydiaChocolate.prototype); +console.log(giveSwarnaPizza.prototype); +console.log(giveSwarnaChocolate.prototype); ```
Answer -Regular functions, such as the `giveLydiaPizza` function, have a `prototype` property, which is an object (prototype object) with a `constructor` property. Arrow functions however, such as the `giveLydiaChocolate` function, do not have this `prototype` property. `undefined` gets returned when trying to access the `prototype` property using `giveLydiaChocolate.prototype`. +Regular functions, such as the `giveSwarnaPizza` function, have a `prototype` property, which is an object (prototype object) with a `constructor` property. Arrow functions however, such as the `giveSwarnaChocolate` function, do not have this `prototype` property. `undefined` gets returned when trying to access the `prototype` property using `giveSwarnaChocolate.prototype`.
@@ -5473,7 +5475,7 @@ Regular functions, such as the `giveLydiaPizza` function, have a `prototype` pro ```javascript const person = { - name: "Lydia", + name: "Hari Srinivas", age: 21, }; @@ -5486,11 +5488,11 @@ for (const [x, y] of Object.entries(person)) { `Object.entries(person)` returns an array of nested arrays, containing the keys and objects: -`[ [ 'name', 'Lydia' ], [ 'age', 21 ] ]` +`[ [ 'name', 'Hari Srinivas' ], [ 'age', 21 ] ]` Using the `for-of` loop, we can iterate over each element in the array, the subarrays in this case. We can destructure the subarrays instantly in the for-of loop, using `const [x, y]`. `x` is equal to the first element in the subarray, `y` is equal to the second element in the subarray. -The first subarray is `[ "name", "Lydia" ]`, with `x` equal to `"name"`, and `y` equal to `"Lydia"`, which get logged. +The first subarray is `[ "name", "Hari Srinivas" ]`, with `x` equal to `"name"`, and `y` equal to `"Hari Srinivas"`, which get logged. The second subarray is `[ "age", 21 ]`, with `x` equal to `"age"`, and `y` equal to `21`, which get logged.
@@ -5567,7 +5569,7 @@ This means that `a + b` is never reached, since a function stops running after t ```javascript class Person { constructor() { - this.name = "Lydia"; + this.name = "Anima Nagarajan"; } } @@ -5621,7 +5623,7 @@ const getList = ([x, ...y]) => [x, y] const getUser = user => { name: user.name, age: user.age } const list = [1, 2, 3, 4] -const user = { name: "Lydia", age: 21 } +const user = { name: "Anima Nagarajan", age: 21 } console.log(getList(list)) console.log(getUser(user)) @@ -5650,7 +5652,7 @@ Since no value gets returned in this case, the function returns `undefined`. ## Q. What is the output? ```javascript -const name = "Lydia"; +const name = "Anima Nagarajan"; console.log(name()); ``` @@ -5758,8 +5760,8 @@ This means that it waited for the `myPromise` to resolve with the value `I have const set = new Set(); set.add(1); -set.add("Lydia"); -set.add({ name: "Lydia" }); +set.add("Anima Nagarajan"); +set.add({ name: "Anima Nagarajan" }); for (let item of set) { console.log(item + 2); @@ -5772,9 +5774,9 @@ The `+` operator is not only used for adding numerical values, but we can also u The first one is `1`, which is a numerical value. `1 + 2` returns the number 3. -However, the second one is a string `"Lydia"`. `"Lydia"` is a string and `2` is a number: `2` gets coerced into a string. `"Lydia"` and `"2"` get concatenated, which results in the string `"Lydia2"`. +However, the second one is a string `"Anima Nagarajan"`. `"Anima Nagarajan"` is a string and `2` is a number: `2` gets coerced into a string. `"Anima Nagarajan"` and `"2"` get concatenated, which results in the string `"Anima Nagarajan2"`. -`{ name: "Lydia" }` is an object. Neither a number nor an object is a string, so it stringifies both. Whenever we stringify a regular object, it becomes `"[Object object]"`. `"[Object object]"` concatenated with `"2"` becomes `"[Object object]2"`. +`{ name: "Anima Nagarajan" }` is an object. Neither a number nor an object is a string, so it stringifies both. Whenever we stringify a regular object, it becomes `"[Object object]"`. `"[Object object]"` concatenated with `"2"` becomes `"[Object object]2"`.
@@ -5811,7 +5813,7 @@ function compareMembers(person1, person2 = person) { } } -const person = { name: "Lydia" }; +const person = { name: "Surya Jha" }; compareMembers(person); ``` @@ -5865,7 +5867,7 @@ JavaScript interprets (or unboxes) statements. When we use bracket notation, it ## Q. What is the output? ```javascript -let name = "Lydia"; +let name = "Surya Jha"; function getName() { console.log(name); @@ -5881,16 +5883,16 @@ Each function has its own _execution context_ (or _scope_). The `getName` functi Variables with the `let` keyword (and `const`) are hoisted, but unlike `var`, don\'t get initialized. They are not accessible before the line we declare (initialize) them. This is called the "temporal dead zone". When we try to access the variables before they are declared, JavaScript throws a `ReferenceError`. -If we wouldn\'t have declared the `name` variable within the `getName` function, the javascript engine would\'ve looked down the _scope chain_. The outer scope has a variable called `name` with the value of `Lydia`. In that case, it would\'ve logged `Lydia`. +If we wouldn\'t have declared the `name` variable within the `getName` function, the javascript engine would\'ve looked down the _scope chain_. The outer scope has a variable called `name` with the value of `Surya Jha`. In that case, it would\'ve logged `Surya Jha`. ```javascript -let name = "Lydia"; +let name = "Surya Jha"; function getName() { console.log(name); } -getName(); // Lydia +getName(); // Surya Jha ```
@@ -6014,7 +6016,7 @@ When adding a key/value pair using the `set` method, the key will be the value o ```javascript const person = { - name: "Lydia", + name: "Kani Palla", age: 21, }; @@ -6034,9 +6036,9 @@ console.log(person); Both the `changeAge` and `changeAgeAndName` functions have a default parameter, namely a _newly_ created object `{ ...person }`. This object has copies of all the key/values in the `person` object. -First, we invoke the `changeAge` function and pass the `person` object as its argument. This function increases the value of the `age` property by 1. `person` is now `{ name: "Lydia", age: 22 }`. +First, we invoke the `changeAge` function and pass the `person` object as its argument. This function increases the value of the `age` property by 1. `person` is now `{ name: "Kani Palla", age: 22 }`. -Then, we invoke the `changeAgeAndName` function, however we don\'t pass a parameter. Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it\'s a new object, it doesn\'t affect the values of the properties on the `person` object. `person` is still equal to `{ name: "Lydia", age: 22 }`. +Then, we invoke the `changeAgeAndName` function, however we don\'t pass a parameter. Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it\'s a new object, it doesn\'t affect the values of the properties on the `person` object. `person` is still equal to `{ name: "Kani Palla", age: 22 }`.
From eb2351ce87d1c11675a779317267f35feb70ce26 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Tue, 22 Nov 2022 09:05:00 +0530 Subject: [PATCH 093/117] Update README.md --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index aa468a8..091d5c9 100644 --- a/README.md +++ b/README.md @@ -6054,6 +6054,14 @@ if(2 == true) if(2 == false) ``` +
Answer + +```js +SyntaxError: Unexpected end of input +``` + +
+ @@ -6072,8 +6080,28 @@ function find_max(nums) { } ``` +
Answer + +```js +function find_max(nums) { + let max_num = Number.NEGATIVE_INFINITY; // smaller than all other numbers + for (let num of nums) { + if (num > max_num) { + max_num = num; + } + } + return max_num; +} + +const nums = [10, 20, -30]; +console.log(find_max(nums)); +``` + **⚝ [Try this example on CodeSandbox](https://codesandbox.io/s/js-code-practice-xjw5n3)** +
+ + From 4404c90e7d8b57d378f3394126a9ad65573f4546 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Tue, 22 Nov 2022 09:49:02 +0530 Subject: [PATCH 094/117] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 091d5c9..d1e42cd 100644 --- a/README.md +++ b/README.md @@ -6034,12 +6034,17 @@ console.log(person);
Answer +```js Both the `changeAge` and `changeAgeAndName` functions have a default parameter, namely a _newly_ created object `{ ...person }`. This object has copies of all the key/values in the `person` object. First, we invoke the `changeAge` function and pass the `person` object as its argument. This function increases the value of the `age` property by 1. `person` is now `{ name: "Kani Palla", age: 22 }`. Then, we invoke the `changeAgeAndName` function, however we don\'t pass a parameter. Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it\'s a new object, it doesn\'t affect the values of the properties on the `person` object. `person` is still equal to `{ name: "Kani Palla", age: 22 }`. +// Output: +{ name: 'Kani Palla', age: 22 } +``` +
From 61504e4bc8067978f28380b00589c8485a61ca97 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Tue, 22 Nov 2022 11:06:37 +0530 Subject: [PATCH 095/117] Update README.md --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d1e42cd..6bdca8c 100644 --- a/README.md +++ b/README.md @@ -6035,11 +6035,17 @@ console.log(person);
Answer ```js -Both the `changeAge` and `changeAgeAndName` functions have a default parameter, namely a _newly_ created object `{ ...person }`. This object has copies of all the key/values in the `person` object. +Both the `changeAge` and `changeAgeAndName` functions have a default parameter, +namely a _newly_ created object `{ ...person }`. This object has copies of all +the key/values in the `person` object. -First, we invoke the `changeAge` function and pass the `person` object as its argument. This function increases the value of the `age` property by 1. `person` is now `{ name: "Kani Palla", age: 22 }`. +First, we invoke the `changeAge` function and pass the `person` object as its argument. +This function increases the value of the `age` property by 1. `person` is now +`{ name: "Kani Palla", age: 22 }`. -Then, we invoke the `changeAgeAndName` function, however we don\'t pass a parameter. Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it\'s a new object, it doesn\'t affect the values of the properties on the `person` object. `person` is still equal to `{ name: "Kani Palla", age: 22 }`. +Then, we invoke the `changeAgeAndName` function, however we don\'t pass a parameter. +Instead, the value of `x` is equal to a _new_ object: `{ ...person }`. Since it\'s a +new object, it doesn\'t affect the values of the properties on the `person` object. // Output: { name: 'Kani Palla', age: 22 } From 195d3e2a69fd28fee4259c53cc12354933da002b Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Wed, 23 Nov 2022 10:39:29 +0530 Subject: [PATCH 096/117] Update program-writing.md --- program-writing.md | 55 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/program-writing.md b/program-writing.md index 888cc0a..c6db46b 100644 --- a/program-writing.md +++ b/program-writing.md @@ -2,7 +2,7 @@
-## Q. Write a function to get result in group by parameter? +## Q. Write a function to transform json in group by parameter? **Examples:** @@ -50,6 +50,59 @@ console.log(groupBy(arry, "Phase")); ↥ back to top
+## Q. Write a function to transform json in group by id? + +**Examples:** + +```js +Input: + +[ + { id: 1, type: "ADD" }, + { id: 1, type: "CHANGE" }, + { id: 2, type: "ADD" }, + { id: 3, type: "ADD" }, + { id: 3, type: "CHANGE" }, + { id: 2, type: "REMOVE" }, + { id: 3, type: "CHANGE" }, + { id: 1, type: "REMOVE" }, +]; + +Output: + +[ + { id: 1, type: ["ADD", "CHANGE", "REMOVE"] }, + { id: 2, type: ["ADD", "REMOVE"] }, + { id: 3, type: ["ADD", "CHANGE", "CHANGE"] }, +]; +``` + +
Answer + +```javascript +const groupBy = (arr = []) => { + const result = []; + const map = {}; + for (let i = 0, j = arr.length; i < j; i++) { + let element = arr[i]; + if (!(element.id in map)) { + map[element.id] = {id: element.id, type: []}; + result.push(map[element.id]); + }; + map[element.id].type.push(element.type); + }; + return result; +}; + +console.log(groupBy(arr)); +``` + +
+ + + ## Q. Write a function to accept argument like `sum(num1)(num2);` or `sum(num1,num2);` **Examples:** From e40bc208759d6bae45d6a80d8adab9968a6ff77e Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Wed, 23 Nov 2022 11:01:33 +0530 Subject: [PATCH 097/117] Update program-writing.md --- program-writing.md | 70 +++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/program-writing.md b/program-writing.md index c6db46b..deb8905 100644 --- a/program-writing.md +++ b/program-writing.md @@ -103,6 +103,44 @@ console.log(groupBy(arr)); ↥ back to top
+## Q. Write a function to find non-repetitive numbers in a given array? + +**Examples:** + +```js +Input: +[2, 3, 4, 3, 3, 2, 4, 9, 1, 2, 5, 5] + +Output: +[9, 1] +``` + +
Answer + +```javascript +// Creating Object with number of occurance of each elements +for(let element of arr) { + if(count[element]) { + count[element] += 1; + } else { + count[element] = 1; + } +} + +// Iterate Unique elements +for(let key in count) { + if(count[key] === 1) { + console.log(key + '->' + count[key]); + } +} +``` + +
+ + + ## Q. Write a function to accept argument like `sum(num1)(num2);` or `sum(num1,num2);` **Examples:** @@ -2117,38 +2155,6 @@ console.log(getObjectProperty(data, path)); ↥ back to top -## Q. Find the unique number in given array? - -**Example:** - -```js -Input: [1, 1, 3, 2, 3] -Output: 2 -``` - -
Answer - -```js -const arr = [1, 1, 3, 2, 3]; -const count = {}; - -for (const element of arr) { - if (count[element]) { - count[element] += 1; - } else { - count[element] = 1; - } -} - -console.log(count); // {1: 2, 2: 1, 3: 2} -``` - -
- - - ## Q. Print all pairs with given sum? **Example:** From 0894f1d5250881332a499937d895f8f55d656030 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Wed, 23 Nov 2022 15:29:38 +0530 Subject: [PATCH 098/117] Update program-writing.md --- program-writing.md | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/program-writing.md b/program-writing.md index deb8905..68477ae 100644 --- a/program-writing.md +++ b/program-writing.md @@ -1972,7 +1972,7 @@ console.log(hasPairSum([1, 2, 4, 4], 8)); // true ↥ back to top -## Q. Write a Binary Search Program [Array should be sorted]? +## Q. Write a Binary Search Program (array should be sorted)? **Example:** @@ -2196,6 +2196,45 @@ getPairs([1, 5, 7, -1, 5], 6); ↥ back to top +## Q. Write a function to find out duplicate words in a given string? + +**Example:** + +```js +Input: +"big black bug bit a big black dog on his big black nose" + +Output: +"big black" +``` + +
Answer + +```js +const str = "big black bug bit a big black dog on his big black nose"; + +const findDuplicateWords = (str) => { + const strArr = str.split(" "); + const res = []; + for (let i = 0; i < strArr.length; i++) { + if (strArr.indexOf(strArr[i]) !== strArr.lastIndexOf(strArr[i])) { + if (!res.includes(strArr[i])) { + res.push(strArr[i]); + } + } + } + return res.join(" "); +}; + +console.log(findDuplicateWords(str)); +``` + +
+ + + ## Q. Improve the below function? ```js From 6adf22c4854cbec015064d43d5e689558a667eca Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sat, 26 Nov 2022 13:06:45 +0530 Subject: [PATCH 099/117] Update program-writing.md --- program-writing.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/program-writing.md b/program-writing.md index 68477ae..90f0339 100644 --- a/program-writing.md +++ b/program-writing.md @@ -141,6 +141,37 @@ for(let key in count) { ↥ back to top +## Q. Write a function to accept string and find first non-repeated character? + +**Examples:** + +```js +Input: 'aabcbd' +Output: 'c' +``` + +
Answer + +```javascript +function firstNonRepeatingCharacter(str) { + for (let i = 0; i < str.length; i++) { + let char = str[i]; + if (str.indexOf(char) == i && str.indexOf(char, i + 1) == -1) { + return char; + } + } + return "_"; +} + +console.log(firstNonRepeatingCharacter("aabcbd")); +``` + +
+ + + ## Q. Write a function to accept argument like `sum(num1)(num2);` or `sum(num1,num2);` **Examples:** From 31b18119bea6db044b2cf29d70ce8a327c278409 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sat, 26 Nov 2022 13:20:17 +0530 Subject: [PATCH 100/117] Update program-writing.md --- program-writing.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/program-writing.md b/program-writing.md index 90f0339..376da4f 100644 --- a/program-writing.md +++ b/program-writing.md @@ -156,14 +156,19 @@ Output: 'c' function firstNonRepeatingCharacter(str) { for (let i = 0; i < str.length; i++) { let char = str[i]; - if (str.indexOf(char) == i && str.indexOf(char, i + 1) == -1) { + if (str.indexOf(char) === str.lastIndexOf(char)) { return char; } } return "_"; } -console.log(firstNonRepeatingCharacter("aabcbd")); +console.log(firstNonRepeatingCharacter("aabcbd")); // c + +console.log(firstNonRepeatingCharacter("teeter")); // r + +console.log(firstNonRepeatingCharacter("abacddbec")); // e + ```
From 3b826292bd71dc036aa10945cf6ae13627c480c7 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sat, 26 Nov 2022 13:21:44 +0530 Subject: [PATCH 101/117] Update program-writing.md --- program-writing.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/program-writing.md b/program-writing.md index 376da4f..3b9a3dd 100644 --- a/program-writing.md +++ b/program-writing.md @@ -148,6 +148,12 @@ for(let key in count) { ```js Input: 'aabcbd' Output: 'c' + +Input: 'teeter' +Output: 'r' + +Input: 'abacddbec' +Output: 'e' ```
Answer From 85d94ecb3ab47d9e688c8aa694f55832920efed3 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sat, 26 Nov 2022 16:25:00 +0530 Subject: [PATCH 102/117] Update program-writing.md --- program-writing.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/program-writing.md b/program-writing.md index 3b9a3dd..cd17c6b 100644 --- a/program-writing.md +++ b/program-writing.md @@ -183,6 +183,70 @@ console.log(firstNonRepeatingCharacter("abacddbec")); // e ↥ back to top +## Q. Write a function to sort an integer array? + +**Examples:** + +```js +Input: [ 53, 11, 34, 12, 18 ] +Output: [ 11, 12, 18, 34, 53 ]; +``` + +
Answer + +**Solution 1:** + +```javascript +/** + * Optimized implementation of bubble sort Algorithm + */ +function bubbleSort(arr) { + let isSwapped = false; + + for (let i = 0; i < arr.length; i++) { + isSwapped = false; + + for (let j = 0; j < arr.length; j++) { + if (arr[j] > arr[j + 1]) { + let temp = arr[j]; + arr[j] = arr[j + 1]; + arr[j + 1] = temp; + isSwapped = true; + } + } + + // If no two elements were swapped by inner loop, then break + if (!isSwapped) { + break; + } + } + return arr; +} + +console.log(bubbleSort([53, 11, 34, 12, 18])); +``` + +**Solution 2:** + +```js +/** + * Sort elements using compare method + */ +let arr = [53, 11, 34, 12, 18]; + +arr.sort(function (a, b) { + return a - b; +}); + +console.log(arr); +``` + +
+ + + ## Q. Write a function to accept argument like `sum(num1)(num2);` or `sum(num1,num2);` **Examples:** From f8ea0f91b369f4161a7899e9b858767e2b1a8bf8 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sat, 26 Nov 2022 16:36:38 +0530 Subject: [PATCH 103/117] Update program-writing.md --- program-writing.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/program-writing.md b/program-writing.md index cd17c6b..ccdf0da 100644 --- a/program-writing.md +++ b/program-writing.md @@ -196,6 +196,21 @@ Output: [ 11, 12, 18, 34, 53 ]; **Solution 1:** +```js +/** + * Sort elements using compare method + */ +let arr = [53, 11, 34, 12, 18]; + +arr.sort((a, b) => { + return a - b; +}); + +console.log(arr); +``` + +**Solution 2:** + ```javascript /** * Optimized implementation of bubble sort Algorithm @@ -226,20 +241,7 @@ function bubbleSort(arr) { console.log(bubbleSort([53, 11, 34, 12, 18])); ``` -**Solution 2:** -```js -/** - * Sort elements using compare method - */ -let arr = [53, 11, 34, 12, 18]; - -arr.sort(function (a, b) { - return a - b; -}); - -console.log(arr); -```
From 8d2b9b542527f90cbe4e01bdec818132c2740234 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sat, 26 Nov 2022 20:06:36 +0530 Subject: [PATCH 104/117] Update program-writing.md --- program-writing.md | 58 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/program-writing.md b/program-writing.md index ccdf0da..45278de 100644 --- a/program-writing.md +++ b/program-writing.md @@ -241,7 +241,65 @@ function bubbleSort(arr) { console.log(bubbleSort([53, 11, 34, 12, 18])); ``` +
+ + + +## Q. Write a program to read file and count word count, unique word count and count search string? + +**Examples:** + +```js +Input: file.txt +Search String: 'Lipsum' +Output: +┌──────────────┬────────┐ +│ (index) │ Values │ +├──────────────┼────────┤ +│ Word Count │ 22 │ +│ Unique Words │ 17 │ +│ searchString │ 18 │ +└──────────────┴────────┘ +``` + +
Answer +```js +const fs = require("fs"); + +// #1 count the number of words +const wordCount = (string) => string.split(" ").length; + +// #2 count the number of unique words +const uniqueWords = (txt) => new Set(txt.toLowerCase().match(/\w+/g)).size; + +// #3 count the search string +const searchString = (string) => { + let count = 0; + let words = string.split(" "); + + for (let i = 0; i < words.length; i++) { + if (words[i].indexOf("ispsum")) { + count++; + } + } + return count; +}; + +fs.readFile("file.txt", "utf8", function (err, data) { + if (err) throw err; + console.log("The text in the file:\n\n", data, "\n"); + // store results in an object to present the log better + let result = { + "Word Count": wordCount(data), + "Unique Words": uniqueWords(data), + searchString: searchString(data), + }; + console.table(result); +}); +```
From 190415d8413f32bd6600f57903153ddbe8676469 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sat, 26 Nov 2022 20:08:44 +0530 Subject: [PATCH 105/117] Update program-writing.md --- program-writing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program-writing.md b/program-writing.md index 45278de..03631cc 100644 --- a/program-writing.md +++ b/program-writing.md @@ -247,7 +247,7 @@ console.log(bubbleSort([53, 11, 34, 12, 18])); ↥ back to top -## Q. Write a program to read file and count word count, unique word count and count search string? +## Q. Write a program to read file and count word, unique word and search string? **Examples:** From 1c1abae70e5132d1cb415dad45ed89109ee056c4 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 27 Nov 2022 11:29:14 +0530 Subject: [PATCH 106/117] Update program-writing.md --- program-writing.md | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/program-writing.md b/program-writing.md index 03631cc..9792df3 100644 --- a/program-writing.md +++ b/program-writing.md @@ -307,6 +307,53 @@ fs.readFile("file.txt", "utf8", function (err, data) { ↥ back to top +## Q. Find the most repeated elements in given array? + +**Examples:** + +```js +Input: [1, 2, 3, 4, 5, 1] +Output: [1, 2] + +Input: [12, 5, 6, 76, 23, 12, 34, 5, 23, 34, 65, 34, 22, 67, 34] +Output: [34, 4] + +Input: [2, 1, 10, 7, 10, 3, 10, 8, 7, 3, 10, 5, 4, 6, 7, 9, 9, 9, 9, 6, 3, 7, 6, 9, 8, 9, 10] +Output: [9, 6] +``` + +
Answer + +```js +function mostFrequentElement(array) { + let count = {}; + let maxElement = array[0]; + let maxCount = 1; + + for (let i = 0; i < array.length; i++) { + let element = array[i]; + if (count[element]) { + count[element] += 1; + } else { + count[element] = 1; + } + if (count[element] > maxCount) { + maxElement = element; + maxCount = count[element]; + } + } + return [maxElement, maxCount]; +} + +console.log(mostFrequentElement([12, 5, 6, 76, 23, 12, 34, 5, 23, 34, 65, 34, 22, 67, 34])); // [34, 4] +``` + +
+ + + ## Q. Write a function to accept argument like `sum(num1)(num2);` or `sum(num1,num2);` **Examples:** From eda9b7cc5bf8560bbcb44137baad5f4a2b6dbe22 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Sun, 27 Nov 2022 11:59:24 +0530 Subject: [PATCH 107/117] Update program-writing.md --- program-writing.md | 51 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/program-writing.md b/program-writing.md index 9792df3..74e08a7 100644 --- a/program-writing.md +++ b/program-writing.md @@ -329,7 +329,7 @@ function mostFrequentElement(array) { let count = {}; let maxElement = array[0]; let maxCount = 1; - + for (let i = 0; i < array.length; i++) { let element = array[i]; if (count[element]) { @@ -354,6 +354,55 @@ console.log(mostFrequentElement([12, 5, 6, 76, 23, 12, 34, 5, 23, 34, 65, 34, 22 ↥ back to top +## Q. Filter users with age between 15 and 30 from the given json array? + +**Examples:** + +```js +Input: +[ + { + a: { name: "John", age: 25 }, + b: { name: "Peter", age: 45 }, + c: { name: "Bob", age: 20 }, + }, + { + a: { name: "Ram", age: 25 }, + b: { name: "Krish", age: 45 }, + c: { name: "Roshan", age: 20 }, + }, +]; + +Output: +[ + [ { name: 'John', age: 25 }, { name: 'Bob', age: 20 } ], + [ { name: 'Ram', age: 25 }, { name: 'Roshan', age: 20 } ] +] +``` + +
Answer + +```js +function filterUser(arr) { + const users = []; + + for (let i = 0; i < arr.length; i++) { + let element = arr[i]; + let user = Object.values(element).filter((key) => { + return key.age > 15 && key.age < 30; + }); + users.push(user); + } + return users; +} +``` + +
+ + + ## Q. Write a function to accept argument like `sum(num1)(num2);` or `sum(num1,num2);` **Examples:** From 26d577abe31859c8edeeef26731e7be566ccaa5e Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Mon, 28 Nov 2022 15:08:58 +0530 Subject: [PATCH 108/117] Update README.md --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 6bdca8c..752ccbe 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,27 @@ ## Q. Predict the output of the following JS code? +```js +let a = "7" + 3 + 2; +let b = 7 + 3 + "2"; + +console.log(a, b); +``` + +
Answer + +```js +732 102 +``` + +
+ + + +## Q. Predict the output of the following JS code? + ```js const a = { msg: "Hi" }; const b = a; From d0b4d06bf6ba439125edf6d6e7fb5bab5badb0ab Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Mon, 28 Nov 2022 15:20:22 +0530 Subject: [PATCH 109/117] Update README.md --- README.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 752ccbe..012dfca 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,34 @@ console.log(a, b);
Answer ```js -732 102 +732 +102 +``` + +
+ + + +## Q. Predict the output of the following JS code? + +```js +let a = [1, 2, 3, 4]; +let b = a; +let c = [...a]; + +b.splice(3, 1); + +console.log(a, b, c); +``` + +
Answer + +```js +[ 1, 2, 3 ] +[ 1, 2, 3 ] +[ 1, 2, 3, 4 ] ```
From 9cb5bc4216b9bc3108d4089484719aeec21bb949 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Mon, 28 Nov 2022 15:24:28 +0530 Subject: [PATCH 110/117] Update README.md --- README.md | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/README.md b/README.md index 012dfca..0d3617e 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,58 @@ console.log(a, b, c); ## Q. Predict the output of the following JS code? +```js +var b = function () { + console.log("1"); +}; + +b(); + +function b() { + console.log("2"); +} +``` + +
Answer + +```js +1 +``` + +
+ + + +## Q. Predict the output of the following JS code? + +```js +b(); + +function b() { + console.log("2"); +} + +var b = function () { + console.log("1"); +}; +``` + +
Answer + +```js +2 +``` + +
+ + + +## Q. Predict the output of the following JS code? + ```js const a = { msg: "Hi" }; const b = a; From d65b75b8d3cf75622585fc42b95d151e173b154b Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Mon, 28 Nov 2022 15:45:58 +0530 Subject: [PATCH 111/117] Update program-writing.md --- program-writing.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/program-writing.md b/program-writing.md index 74e08a7..5754349 100644 --- a/program-writing.md +++ b/program-writing.md @@ -103,6 +103,35 @@ console.log(groupBy(arr)); ↥ back to top +## Q. Write a function to remove duplicates from an integer array in JavaScript? + +```js +Input: [3, 2, 4, 5, 8, 9, 3, 8, 1, 7, 8, 4, 3, 2] +Output: [1, 2, 3, 4, 5, 7, 8, 9] +``` + +
Answer + +```javascript +function removeDuplicates(arr) { + let result = []; + arr.forEach((element) => { + if (!result.includes(element)) { + result.push(element); + } + }); + return result; +} + +console.log(removeDuplicates(arr)); +``` + +
+ + + ## Q. Write a function to find non-repetitive numbers in a given array? **Examples:** From f066866905aff21c694c5a0a26eb0cc05f04de19 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Mon, 28 Nov 2022 19:29:45 +0530 Subject: [PATCH 112/117] Update README.md --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 0d3617e..288abea 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,34 @@ ## Q. Predict the output of the following JS code? +```js +var obj = { + x: 12, + + getX: function () { + return this.x; + }, +}; + +const output = obj.getX; + +console.log(output()); +``` + +
Answer + +```js +undefined +``` + +
+ + + +## Q. Predict the output of the following JS code? + ```js let a = "7" + 3 + 2; let b = 7 + 3 + "2"; From 066f9d383f5b53774634283f9447bec81c9e4017 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Mon, 28 Nov 2022 19:54:07 +0530 Subject: [PATCH 113/117] Update program-writing.md --- program-writing.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/program-writing.md b/program-writing.md index 5754349..f9b6491 100644 --- a/program-writing.md +++ b/program-writing.md @@ -103,6 +103,33 @@ console.log(groupBy(arr)); ↥ back to top +## Q. Write a program to implement Math.power() function? + +```js +Input: 2, 3 +Output: 8 +``` + +
Answer + +```javascript +function powerOf(base, exponent) { + let result = 1; + for (let i = 1; i <= exponent; i++) { + result = result * base; + } + return result; +} + +console.log(powerOf(2, 3)); +``` + +
+ + + ## Q. Write a function to remove duplicates from an integer array in JavaScript? ```js From fb31fa0de5167f36cbd63185ba24651d48143fc6 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Mon, 28 Nov 2022 19:55:07 +0530 Subject: [PATCH 114/117] Update program-writing.md --- program-writing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program-writing.md b/program-writing.md index f9b6491..96b4f56 100644 --- a/program-writing.md +++ b/program-writing.md @@ -103,7 +103,7 @@ console.log(groupBy(arr)); ↥ back to top -## Q. Write a program to implement Math.power() function? +## Q. Write a function to implement Math.power() function? ```js Input: 2, 3 From e270097a8e401e6aa2aeccd9fe57dfa536d26224 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Mon, 28 Nov 2022 19:57:48 +0530 Subject: [PATCH 115/117] Update program-writing.md --- program-writing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program-writing.md b/program-writing.md index 96b4f56..712efdd 100644 --- a/program-writing.md +++ b/program-writing.md @@ -103,7 +103,7 @@ console.log(groupBy(arr)); ↥ back to top -## Q. Write a function to implement Math.power() function? +## Q. Write a function to implement Math.pow() function? ```js Input: 2, 3 From d9d54a55b687e38c59757a8cc84def4a28f060d9 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Tue, 29 Nov 2022 20:27:44 +0530 Subject: [PATCH 116/117] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 288abea..d05e86e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # JavaScript Coding Practice -*Click if you like the project. Pull Request are highly appreciated.* +> *Click if you like the project. Your contributions are heartily ♡ welcome.*
From e845f20ef251aa86f4bd4bec4e416807f891b4b5 Mon Sep 17 00:00:00 2001 From: Pradeep Kumar Date: Wed, 30 Nov 2022 09:48:18 +0530 Subject: [PATCH 117/117] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d05e86e..e625e6d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # JavaScript Coding Practice -> *Click if you like the project. Your contributions are heartily ♡ welcome.* +> *Click ★ if you like the project. Your contributions are heartily ♡ welcome.*