+ 1
I need correction on this code
<script type="text/javascript"> var critter = new object(); critter.name = "Milo"; critter.age = 30; critter.talk = function (){ msg = " Hi! my name is " + this.name; msg += "and I'm" + this.age + "years old "; alert(msg); } critter.talk(); </script>
2 odpowiedzi
+ 1
here I made it an function but if you want to make it an object tell me I will do it 😬😬😬