NEW
Font size
WorksheetsIMSD_Week-8_CSE-1
Total questions: 10
Worksheet time: 5mins
How do you create a custom object using an object literal?
let obj = new Object();
let obj = {};
let obj = Object();
let obj = object.create();
What is the correct syntax for adding a property to an object?
Which method returns an array of property names of an object?
Object.keys(obj)
Object.get(obj)
Object.list(obj)
obj.keys()
What will this code log?
let obj = {x:10, y:20};
delete obj.y;
console.log(obj.y);
20
null
undefined
error
What does the expression /[0-9]+/ match?
Only a single digit
One or more digits
Any alphabet
Whitespace
The regular expression /\s+/ matches:
A single space
Any non-space character
One or more whitespace characters
A tab only
Which method replaces text using a regex pattern?
replace()
search()
exec()
test()
What is the output of the code below?
console.log(/cat/.test("concatenate"));
false
undefined
error
true
What does /^A/.test("Apple") return?
false
true
error
0
