What will be the output of the following code?
var str = "Hello";
str.match("jello");

Practice More Questions From: Module quiz: The Building Blocks of a Program

Q:

What data type is the variable x ? var x = {};

Q:

What will be the output of running the following code? try {console.log(‘hello)} catch(e) {console.log(‘caught’)}

Q:

What value is printed when the following code runs? var burger = [“bun”, “beef”, “lettuce”, “tomato sauce”, “onion”, “bun”]; console.log(burger[2]);

Q:

In the following code, how many methods does the bicycle object have? var bicycle = { wheels: 2, start: function() { }, stop: function() { } };

Q:

When the following code runs, what will print out? try {​ throw new Error();​ console.log(‘Hello’); } catch(err) {​ console.log(‘Goodbye’); }

Q:

If you mis-type some code in your JavaScript, what kind of error will that result in?

Q:

Will the following code execute without an error? function add(a, b) { console.log(a + b)​ }​ add(3, “4”);

Q:

What will be printed when the following code runs? var result; console.log(result);

Q:

What will be the output of the following code? var str = “Hello”;str.match(“jello”);

Q:

What will be the output of the following code? try {Number(5).toPrecision(300)} catch(e) {console.log(“There was an error”)}

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments