This keyword in JS

This keyword in JS


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>This keyword in JS</title>

</head>
<body>
<script>

var profile = {
Name :"PRAVEEN",
rank :"EAA3",
section : "ELECTRICAL",
teacher : ["SANIKA","KESHWANIA",25],
fullProfile : function() {
// return profile.Name + " " + profile.rank + " " + profile.section +
// "<br>" + profile.teacher;
return this.Name + " " + this.rank + " " + this.section +
"<br>" + this.teacher;


},


};


console.log(profile);
document.write(profile.fullProfile());


</script>
</body>
</html>





Comments

Popular posts from this blog