JavaScript Questions

0 votes, 0 avg
447

JavaScript Questions

1 / 15

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

var cars = ["Honda","Hyundai","Mahindra"];
 
 var result = cars.shift();
 
 document.writeln("Result: ", cars);

2 / 15

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

3 / 15

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

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

4 / 15

4. Why JavaScript Engine is needed?

5 / 15

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

6 / 15

6. Which of the following is the language of javascript?

7 / 15

7. Which statement is used to skip the iteration of the loop

8 / 15

8. 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);

9 / 15

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

var a = true + true + true * 3;
print(a)

10 / 15

10. Which of the following global variables is used to get parameters?

11 / 15

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

12 / 15

12. The process in which an object or data structure is translated into a format suitable for transferral over a network, or storage is called?

13 / 15

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

function printArray(a) 
{
     var len = a.length, i = 0;
     if (len == 0)
        console.log("Empty Array");
     else 
     {
// do-while loop in javascript
         do 
         {
             console.log(a[i]);
         } while (++i < len);
     }
}

14 / 15

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

15 / 15

15. Which is the correct syntax for the function definition?