var
Obj = {
val: 10,
str:
'Hello World!'
}
delete
Obj.val;
function
funMake() {
if
(
'val'
in
Obj) {
document.write(Obj.val +
'<br />'
);
else
{
document.write(
'Error<br />'
'str'
document.write(Obj.str +
'a'
document.write(Obj.a +
var Obj = { val: 10, str: 'Hello World!' } delete Obj.val; function funMake() { if('val' in Obj) { document.write(Obj.val + ''); } else { document.write('Error'); } if('str' in Obj) { document.write(Obj.str + ''); } else { document.write('Error'); } if('a' in Obj) { document.write(Obj.a + ''); } else { document.write('Error'); } }
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
script
src
"js/script.js"
></
</
body
funMake();