+ 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>

18th Jul 2017, 2:48 PM
Anuwom G. Chuks
Anuwom G. Chuks - avatar
2 Antworten
+ 1
here I made it an function but if you want to make it an object tell me I will do it 😬😬😬
18th Jul 2017, 3:18 PM
_Retr0/-
_Retr0/- - avatar
18th Jul 2017, 3:18 PM
_Retr0/-
_Retr0/- - avatar