Home > Web Front-end > JS Tutorial > The simplest javascript object example code_js object-oriented

The simplest javascript object example code_js object-oriented

WBOY
Release: 2016-05-16 18:39:16
Original
936 people have browsed it


[Ctrl A Select all Note: If you need to introduce external Js, you need to refresh to execute
]

Two types of JavaScript object-oriented Writing methods and differenceshttp://www.jb51.net/article/13211.htm

JavaScript Object-Oriented Introduction to Condensed Editionhttp://www.jb51 .net/article/17541.htm<script> function user() { this.age=21; this.name="zhangsan"; this.say=function(){ alert("hello"); } } var u = new user(); alert(u["age"]); alert(u.name); u.say(); </script>
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template