Two types of javascript object

 The JavaScript is object based scripting language and so mostly the object is used access the value or function in which there are several types in it they are

This are the two types that are used to access object and its properties.

  • object literal
  • object array

try{
  sr={};//object literal
sd=[];//object array
  rds:function
pl = new Object();
pl.s="sam";
pl.d=1;
pl.c="dadawd";
sr.s="samuel";
sd.s="jar";

alert(pl.s);
alert(sr.s);
alert(sd.s);

}
catch(err) {
    alert(err.message);
}


Comments

Popular posts from this blog

create pdf by using javascript

yii framework simple shopping cart tutorial for beginners

yii2 arrayhelper::map vs array_map