Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- http://www.w3schools.com/jsref/jsref_prototype_math.asp
- http://javascriptweblog.wordpress.com/2010/06/07/understanding-javascript-prototypes/
- <script type="text/javascript">
- function employee(name,jobtitle,born)
- {
- this.name=name;
- this.jobtitle=jobtitle;
- this.born=born;
- }
- var fred=new employee("Fred Flintstone","Caveman",1970);
- employee.prototype.salary= x();
- function x(){return 20000;};
- employee.prototype.salarie = function (){return 500;};
- document.write(fred.salarie());
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement