InterviewSolution
Saved Bookmarks
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Which function of an Array object calls a function for each element in the array?(A) forEach()(B) every()(C) forEvery()(D) each() |
| Answer» | |
| 2. |
What will be the output of the following code?<script>let ans = 6 / "3";document.write(typeof ans);</script>(A) ‘integer’(B) ‘string’(C) ‘number’(D) None of the above |
| Answer» | |
| 3. |
What will be the output of the following code?<script>document.write(typeof('1' + 2));</script>(A) ‘number’(B) ‘string’(C) ‘boolean’(D) None of the above |
| Answer» | |
| 4. |
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) None of the mentioned |
| Answer» | |
| 5. |
Which of the following variable names are correct according to javascript? (Multiple Choices may be correct)(A) let 1name;(B) let #name;(C) let _name;(D) let $_name; |
| Answer» | |
| 6. |
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 above |
| Answer» | |
| 7. |
Is a variable named ‘apple’ same as ‘Apple’ in javascript?(A) Yes(B) No(C) Only when we use ‘strict’(D) None of the above |
| Answer» | |
| 8. |
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 the above |
| Answer» | |
| 9. |
What is the correct syntax for referring to an external script called ‘gfg.js’?(A) <script name=”gfg.js”>(B) <script href=”gfg.js”>(C) <script src=”gfg.js”>(D) None of these |
| Answer» | |
| 10. |
How many ways are there with which we can declare a variable in javascript?(A) Only one(B) Three(C) Infinitely many(D) None of the above |
| Answer» | |
| 11. |
Inside which HTML element do we put the JavaScript?(A) <javascript>(B) <js>(C) <src>(D) <script> |
| Answer» | |
| 12. |
Is it necessary for the external script file to contain a <script> tag?(A) Yes(B) No(C) Depends on the type of include(D) None of the above |
| Answer» | |
| 13. |
What will be the output of the following code snippetconst str1=’GeeksforGeeks’const str2=str1.slice(2,5)console.log(str2)(A) eks(B) eksf(C) Geek(D) Geeksf |
| Answer» | |
| 14. |
What will be the output of the following codeconst arr=new set([1,2,2,3,3,4,4,4,4,5,6])console.log(arr)(A) [1,2,3](B) [1,2,3,4,5,6](C) [5,6](D) None of the above |
| Answer» | |
| 15. |
What will be the output of the following code snippetconst str1=’Geeksfor’const str2=’Geeks’const str3=str1.concat(str2)console.log(str3)(A) GeeksforGeeks(B) GeeksGeeksfor(C) undefined(D) None of the above |
| Answer» | |
| 16. |
What will be the output of the following code snippetconst arr=[1,2,3,4,5]console.log(…arr)(A) [1 2 3 4 5](B) …[1 2 3 4 5](C) 1 2 3 4 5(D) …1 2 3 4 5 |
| Answer» | |
| 17. |
The ________ used to remove a binding(A) UnBind()(B) unbind()(C) unBind()(D) None of the above |
| Answer» | |