Horje Website
Accessing Object Property Values in Older Versions of JavaScript – JavaScript Code

Accessing Object Property Values in Older Versions of JavaScript

Accessing Object Property Values in Older Versions of JavaScript - JavaScript Code


 
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Accessing Object Property Values in Older Versions of JavaScript</title>
  6. </head>
  7. <body>
  8. <script>
  9. // ES5 syntax
  10. var person = {name: "Peter", age: 28};
  11. var name = person.name;
  12. var age = person.age;
  13. document.write(name); // Peter
  14. document.write("<br>");
  15. document.write(age); // 28
  16. </script>
  17. </body>
  18. </html>



Try Your Self ->



Published:
September 12, 2020
Author:
admin
Category:
JavaScript Example, Javascript Source Code
Views:
14

This article was posted in JavaScript Example, Javascript Source Code and tagged , , . Bookmark the permalink. Follow comments with the RSS feed for this post.Post a Comment or leave a trackback: Trackback URL.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Horje © 2011 - 2022