Skip to content

Instantly share code, notes, and snippets.

@suddeb
Created January 28, 2019 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suddeb/7e0680e17584f71f4eb014edd778bc36 to your computer and use it in GitHub Desktop.
Save suddeb/7e0680e17584f71f4eb014edd778bc36 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/vocijix
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
//Property name at declaration
var student = {
"name":"Sudipta Deb"
}
//This will throw an error as the function is not yet defined.
student.sayFullName();
//Let's add the function as runtime
student.sayFullName = function(){
console.log('FullName: ' + this.name);
}
//This time it will print the fullname
student.sayFullName();
</script>
<script id="jsbin-source-javascript" type="text/javascript">//Property name at declaration
var student = {
"name":"Sudipta Deb"
}
//This will throw an error as the function is not yet defined.
student.sayFullName();
//Let's add the function as runtime
student.sayFullName = function(){
console.log('FullName: ' + this.name);
}
//This time it will print the fullname
student.sayFullName();</script></body>
</html>
//Property name at declaration
var student = {
"name":"Sudipta Deb"
}
//This will throw an error as the function is not yet defined.
student.sayFullName();
//Let's add the function as runtime
student.sayFullName = function(){
console.log('FullName: ' + this.name);
}
//This time it will print the fullname
student.sayFullName();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment