J-Test 0% J-Test Please Fill the Form before Start. 1 / 30 What will Boolean([]) return? True False undefined error 2 / 30 Which of the following is used to handle errors in JavaScript? try...catch if...else throw...return switch...case 3 / 30 What does the await keyword do in an async function? Pauses the function execution until the Promise is resolved Rejects the function automatically Converts a function into a Promise Executes the code in parallel 4 / 30 What does the async keyword before a function signify? The function runs in a separate thread The function returns a promise The function is slower The function blocks the main thread 5 / 30 The pop() method of the array does which of the following task? decrements the total length by 1 increments the total length by 1 prints the first element but no effect on the length updates the element 6 / 30 What will be the output of the following JavaScript code? var grade='A'; var result=0; switch(grade) { case 'A': result+=10; case 'B': result+=9; case 'C': result+=8; default: result+=0; } document.write(result); 10 27 8 0 7 / 30 What is a block statement in JavaScript? conditional block block that contains a single statement both conditional block and a single statement block that combines multiple statements into a single compound statement 8 / 30 A conditional expression is also called a _______________ Alternative to if-else Immediate if If-then-else statement Switch statement 9 / 30 JavaScript is a _______________ language. Object-Oriented High-level Assembly-language Object-Based 10 / 30 The basic purpose of the toLocaleString() is to _________ return a localised object representation return a parsed string return a local time in the string format return a localized string representation of the object 11 / 30 The unordered collection of properties, each of which has a name and a value is called _________ String Object Serialized Object Array 12 / 30 The object has three object attributes namely ________ Class, parameters, object’s extensible flag Prototype, class, objects’ parameters Prototype, class, object’s extensible flag Native object, Classes and Interfaces and Object’s extensible flag 13 / 30 Among the following, which one is a ternary operator? + : ?: - 14 / 30 A function definition expression can be called as __________ Function prototype Function literal Function calling Function declaration 15 / 30 The snippet that has to be used to check if “a” is not equal to “null” is _________ if(a!=null) if (!a) if(a!null) if(a!==null) 16 / 30 What will be the output of the following JavaScript code? let size = 5; let a = 5; for (let j = size; j >= 0; j=a) { document.write(a); a = a - 2; } 5555 5321 531 Infinite loop 17 / 30 Among the keywords below, which one is not a statement? debugger with if use strict 18 / 30 What will be the role of the continue keyword in the following JavaScript code snippet? while (a != 0) { if (a == 1) continue; else a++; } The continue keyword restarts the loop The continue keyword skips the next iteration The continue keyword skips the rest of the statements in that iteration The continue keyword breaks out of the loop 19 / 30 What are the three important manipulations done in a for loop on a loop variable? Updation, Incrementation, Initialization Initialization,Testing, Updation Testing, Updation, Testing Initialization,Testing, Incrementation 20 / 30 What will be the output of the following JavaScript code? var string2Num=parseInt("123xyz"); 123 123xyz Exception NaN 21 / 30 Will the following JavaScript code work? var tensquared = (function(x) {return x*x;}(10)); Yes, perfectly Error Exception will be thrown Memory leak 22 / 30 The method that performs the search-and-replace operation to strings for pattern matching is _______ searchandreplace() add() edit() replace() 23 / 30 Consider the following JavaScript statement containing regular expressions and check if the pattern matches? var text = "testing: 1, 2, 3"; var pattern = /d+/g; text==pattern text.equals(pattern) text.test(pattern) pattern.test(text) 24 / 30 The method that can be used to create new properties and also to modify the attributes of existing properties is _________ Object.defineProperty() Object.defineProperties() Both Object.defineProperty() and Object.defineProperties() Object.inherit() 25 / 30 What will be the output of the following JavaScript code? const object1 = {}; Object.defineProperties(object1, { property1: { value: 10 } }); console.log(object1.property1); 0 10 undefined error 26 / 30 What will be the output of the following JavaScript code? var o = new F(); o.constructor === F False True 0 1 27 / 30 The meaning for Augmenting classes is that ___________ objects inherit prototype properties even in a dynamic state objects inherit prototype properties only in a dynamic state objects inherit prototype properties in the static state object doesn’t inherit prototype properties in the static state 28 / 30 The keyword or the property that you use to refer to an object through which they were invoked is _________ from to this object 29 / 30 The behaviour of the instances present of a class inside a method is defined by __________ Method Classes Interfaces Classes and Interfaces 30 / 30 What is the code to print hello one second from now? setTimeout(function() { console.log(“Hello World”); }, 1000); setTimeout(function() { 1000, console.log(“Hello World”); }); setTimeout(function(1000) { console.log(“Hello World”); }); setTimeout(function() { console.log(“Hello World”); }); Your score isThe average score is 8% 0% By Wordpress Quiz plugin