JavaScript Questions

0 votes, 0 avg
609

JavaScript Questions

1 / 15

1. Which of the following function of the String object returns the character in the string starting at the specified position via the specified number of characters?

2 / 15

2. In JavaScript, what is a block of statement?

3 / 15

3. Which function is used to serialize an object into a JSON string in Javascript?

4 / 15

4. Which of the following is a valid function to truncate number of full minutes between two time stamps?

5 / 15

5. What will be the output of the following JavaScript code?

var arr = [7, 5, 9, 1];  
var min = Math.min.apply(null, arr);  
document.writeln(min);

6 / 15

6. What will be the output of the following code snippet?

var a = 1;  
var b = 0;  
while (a <= 3)  
{  
   a++;  
   b += a * 2;  
   print(b);
}

7 / 15

7. What is the result in the console of running the code shown?
var start = 1;
function setEnd() {
var end = 10;
}
setEnd();
console.log(end);

8 / 15

8. What will be the output of the following JavaScript code?

const arr = [10, 20, 30];
 let result = 0;
 
 arr.forEach(myFunction);
 
 document.write("Result: " , result)
 function myFunction(value, index, array) {
   result += value; 
 }

9 / 15

9. What is the central concept of JavaScript memory management?

10 / 15

10. Which one of the following is correct output for the following given JavaScript code if there is a p tag with id=demo ?
functionourFunction()
{
document.getElementById(“demo”).innerHTML=Math.abs(-7.25);
}

11 / 15

11.  Which of the following can be implemented using animation?

12 / 15

12. What will be the output of the following JavaScript code?

  let cars = ['Honda', 'Hyundai'];
    cars.push('Mahindra');
    document.write(typeof cars + " " + cars); 

13 / 15

13. Which of the following values is not a Boolean false?

14 / 15

14. Which property is used to define the HTML content to an HTML element with a specific id?

15 / 15

15. Which of the following is the correct way for writing Java Script array?

Your score is

0%

Written by Shubhranshu Shekhar, who has trained 20000+ students in coding.