Creating objects using new Object()
var student = new Object();
student.name = 'John';
student.rollNumber = '12';
Creating objects using Literal Notation
var student = {
name : "john",
rollNumber : "12"
}
var student = new Object();
student.name = 'John';
student.rollNumber = '12';
Creating objects using Literal Notation
var student = {
name : "john",
rollNumber : "12"
}
No comments:
Post a Comment