For the previous set please refer to javascript snippets questions set 1. Let's begin with set 2, Q6)What is the result of running this code? sum(10, 20); diff(10, 20); function sum(x, y) { return x + y; } let diff = function (x, y) { return x - y; }; a) 30, ReferenceError, 30, -10 b) 30, ReferenceError c) 30, -10 d) ReferenceError, -10 Q7)Which of the following values is not a Boolean false? a) Boolean(0) b) Boolean("") c) Boolean(NaN) d) Boolean("false") Q8)For the following class, how do you get the value of 42 from an instance of X? class X { get Y() { return 42; } } a) x.get('Y') b) x.Y c) x.Y() d) x.get().Y Q9)What's one difference between the async and defer attributes of the HTML script tag? a) The defer attribute can work synchronously. b) The defer attribute works only with generators. c) The defer attribute works only with promises. d) The defer attribute will asynchronously load the scripts in order. Q10)What val
This website contains interview questions for JavaScript, Nodejs, Html, Css, Datastructure, Mongodb, Angular, Aws and much more intresting articles on different technologies.