Javascript (JS) Shorthand Functions MCQ
This section focuses on the "Javascript Shorthand Functions". 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.
1. What convenience does the following JavaScript code snippet provide?
let suc = function(a) a+1, yes = function() true, no = function() false;
View Answer
2. What does the following JavaScript code snippet do?
data.sort(function(a,b),b-a);
View Answer
3. What is the code to be used to trim whitespaces?
View Answer
4. Which of the following is the descendant operator?
View Answer
5. What is the code required to delete all weight tags?
View Answer
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>
View Answer
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>
View Answer
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>
View Answer
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>
View Answer
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>
View Answer
Also check :
Discussion