Skip to content

Category Archives: Quizzes

What will be the output of the following code const arr=[1,2,3,3,3,4,5,6] const arr2=arr.filter((data)=>{return data!==3}) console.log(arr2.length) (A) 8 (B) 5 (C) 6 (D) 3 Answer: (B)… Read More
What will be the output of the following code const arr=[1,2,3,4,5,6] console.log(arr.slice(1,3)) (A) [2, 3] (B) [2, 3, 4] (C) [2] (D) [1, 2] Answer:… Read More
What will be the output of the following code const arr=[‘arun’,’rishi’,’shivam’,’raj’] console.log(arr.sort()) (A) [‘arun’, ’raj’, ’rishi’, ’shivam’] (B) [’raj’, ‘arun’, ’rishi’, ’shivam’] (C) [’rishi’, ’shivam’,… Read More
What will be the output of the following code const arr=[1,2,3,4,5,6] console.log(arr.pop()) (A) 1 (B) 2 (C) 1 2 3 4 5 (D) 6 Answer:… Read More
Which function of an Array object calls a function for each element in the array? (A) forEach() (B) every() (C) forEvery() (D) each() Answer: (A)… Read More
Which of the following is the pop() method does? (A) Display the first element (B) Decrements length by 1 (C) Increments length by 1 (D)… Read More
Which method is used to insert a new element at the end of an array (A) unshift() (B) push() (C) pop() (D) None of the… Read More
Which of the following is the correct syntax for array declaration (A) const arr={1,2,3,4} (B) const arr=[1,2,3,4] (C) Both a and b (D) None of… Read More
What will be the output of the following code snippet const str1=’GeeksforGeeks’ const str2=str1.slice(2,5) console.log(str2) (A) eks (B) eksf (C) Geek (D) Geeksf Answer: (A)… Read More
What will be the output of the following code snippet const str1=’Geeksfor’ const str2=’Geeks’ const str3=str1.concat(str2) console.log(str3) (A) GeeksforGeeks (B) GeeksGeeksfor (C) undefined (D) None… Read More
What will be the output of the following code? const firstName=’Rishi’ lastName=’Raj’ console.log(“hello ${firstName} , nice to meet you”); (A) hello ${firstName}, nice to meet… Read More
What will be the output of the following code snippet const arr=[1,2,3,4,5] console.log(…arr) (A) [1 2 3 4 5] (B) …[1 2 3 4 5]… Read More
Which data structure is used to maintain a key-value pair in javascript (A) set (B) array (C) Map (D) strings Answer: (C) Explanation: Map data… Read More
Which data structure in javascript is used to maintain only unique values out of the given data (A) Set (B) array (C) strings (D) All… Read More
Which of the two operator have the same syntax of writing (A) Increment and spread operator (B) Spread operator and rest parameter (C) Rest parameter… Read More

Start Your Coding Journey Now!