What will be the output of the following code?
var event = {date: "10-03-2020", name: "JavaScript Conference"}; console.log(event.title);
null
undefined
0
throw an error
JavaScript objects can only have properties. True or false?
var obj = {a: 10};
true
false
What will the following code output to the console?
var person = {name: "John", age: 25}; Object.seal(person); delete person.age; console.log(person.age);
25
var obj = {a: 2, b: 4}; console.log(Object.values(obj));
[2,4]
["a","b"]
[0,1]
["a", 2, "b", 4]
var obj = {x: 3, y: 6}; console.log(Object.keys(obj));
[3,6]
["x","y"]
var obj = {a: 1, b: 2}; Object.freeze(obj); obj.c = 3; console.log(obj.c);
3
var x = Object("xyz"); console.log(x.constructor);
Object
Function
String
var x = new Object(10); console.log(x.constructor);
Number
The prototype inheritance is another name for class-based inheritance. True or false?
var Employee = { company: "xyz" } var emp = Object.create(Employee); delete Employee.company; console.log(emp.company);
xyz