Can’t find an answer?

Can’t find an answer?

Ask us to get the answer

  • This forum is empty.

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

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

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

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

Inside which HTML element do we put the JavaScript?
(A) <javascript>
(B) <js>
(C) <src>
(D) <script>

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

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

What will be the output of the following code
const 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

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 of the above

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]
(C) 1 2 3 4 5
(D) …1 2 3 4 5

Viewing 15 topics - 46 through 60 (of 74 total)

1 2 3 4 5
  • You must be logged in to create new topics.