// Ex 1 : Program(with function & using without this keyword)
<script>
var emp = {
Devloper:{
Name:"Rohit Kumar",
salary: 25000,
}
}
document.write(
"Name : "+emp.Devloper.Name+"<br>"
+"Salary : "+emp.Devloper.salary+"<br>"
)
</script>
Out Put : suresh Singh
Ram Kumar
// ex 2 : Program(with function & using with this keyword)
<script>
var a = {
fname : ["Ram", "suresh", "Ganesh"],
lname :["Kumar", "Singh", "Gupta"],
fullname: function myfunc(){
return this.fname[1]+" " +this.lname[1]
}
}
document.write(a.fullname());
</script>
Out Put :
Name : Rohit Kumar
Salary : 25000