Q. Which one of the following is the correct output for the given JavaScript code?
Code: const obj ={prop:12};
Object.preventExtensions(obj);
console.log(Object.isExtensible(obj));
Dear candidates you will find MCQ questions of JavaScript here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
const obj ={prop:12};
Object.preventExtensions(obj);
console.log(Object.isExtensible(obj));
const obj1 ={ property1:'15'};
const obj2 =Object.freeze(obj1);
obj2.property1='20';
console.log(obj2.property1);
const object1 ={
property1:20
};
console.log(Object.is(object1));
const obj1 =
{
property1:21
}
const descriptor1 =Object.getOwnPropertyDescriptor(obj1),'
console.log(descriptor1.configurable);
console.log(descriptor1.enumerable);
const object1 ={};
a = Symbol('a');
b =Symbol.for('b');
object1[a]='harry';
object1[b]='derry';
constobjectSymbols=Object.getOwnPropertySymbols(object1);
console.log(objectSymbols.length);
<script>
o = {x:1, y:{z:[false,null,""]}};
s = JSON.stringify(o);
p = JSON.parse(s);
</script>
<script>
var article = {
"main title": "How to learn JavaScript",
'sub-title': "The Definitive Guide",
"for": "all audiences",
author: {
firstname: "Scott",
surname: "McCall"
}
}
</script>