Skip to content

Instantly share code, notes, and snippets.

@AminBusiness
Created June 13, 2018 04:08
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 AminBusiness/469d4d7f6b2b60a380c83a4c6d81ec78 to your computer and use it in GitHub Desktop.
Save AminBusiness/469d4d7f6b2b60a380c83a4c6d81ec78 to your computer and use it in GitHub Desktop.
// source https://jsbin.com
var person = {
firstName: "John",
lastName : "Doe",
id : 5566,
};
person.name = function() {
return this.firstName + " " + this.lastName;
};
document.getElementById("demo").innerHTML =
"My father is " + person.name();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var person = {
firstName: "John",
lastName : "Doe",
id : 5566,
};
person.name = function() {
return this.firstName + " " + this.lastName;
};
document.getElementById("demo").innerHTML =
"My father is " + person.name();
</script>
<script id="jsbin-source-javascript" type="text/javascript">
var person = {
firstName: "John",
lastName : "Doe",
id : 5566,
};
person.name = function() {
return this.firstName + " " + this.lastName;
};
document.getElementById("demo").innerHTML =
"My father is " + person.name();
</script></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment