Shorthand Functions in Javascript

@T-Bone

This question paper focuses on the "Shorthand Functions" of Javascript. These Multiple Choice Questions (mcq) should be practiced to improve the Javascript skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

This question paper focuses on the "Shorthand Functions" of Javascript. These Multiple Choice Questions (mcq) should be practiced to improve the Javascript skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

Questions

1. What convenience does the following JavaScript code snippet provide? let suc = function(a) a+1, yes = function() true, no = function() false;

Mark the correct option

2. What does the following JavaScript code snippet do? data.sort(function(a,b),b-a);

Mark the correct option

3. What is the code to be used to trim whitespaces?

Mark the correct option

4. Which of the following is the descendant operator?

Mark the correct option

5. What is the code required to delete all “weight” tags?

Mark the correct option

6. What will be the output of the following JavaScript code? < p id="demo">< /p> < script> var a = 20; var b = "30"; var c = a + b; document.getElementById ("demo").innerHTML = c; < /script>

Mark the correct option

7. What will be the output of the following JavaScript code? < p id="demo">< /p> < script> var a = 20; var b = "30"; document.getElementById ("demo").innerHTML = x + y; < /script>

Mark the correct option

8. What will be the output of the following JavaScript code? < p id="demo">< /p> < script> var a = "10"; var b = "10"; var c = a * b; document.getElementById ("demo").innerHTML = c; < /script>

Mark the correct option

9. What will be the output of the following JavaScript code? < p id="demo">< /p> < script> var a = "10"; var b = "10"; var c = a % b; document.getElementById ("demo").innerHTML = c; < /script>

Mark the correct option

10. What will be the output of the following JavaScript code? < p id="demo">< /p> < script> var a = 63.786; document.getElementById ("demo").innerHTML =a.toFixed(0) < /script>

Mark the correct option

Index of Questions