KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
this is my code: <script type="text/javascript"> var Note=function(){} Note.prototype = { get id() { if (!("_id" in this)) this._id = 0; return this._id; }, set id(x) { this._id = x; } } var a=new Note() alert(a.id) </script> this style is like to python , this is my first time to see this code , and can you give me more example about 'get' and 'set' in javascript . thanks
Tags (comma-separated)
Save Edits
Cancel