Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body>
- <p id="demo"></p>
- <script>
- var person = {
- firstName: "John",
- lastName: "Carlsson",
- fullName : function() {return this.firstName + " " + this.lastName;}
- /*.this means that take another member from the same object to the other member
- of the same object.*/
- };
- document.getElementById("demo").innerHTML = person.fullName();
- </script>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement