Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Maria Dan
Added: May 18, 2021 4:24 PM
Modified: May 18, 2021 4:25 PM
Views: 496
Tags: no tags
  1. let Animal = function(type){
  2.   this.type = type
  3. }
  4.  
  5. Animal.prototype.sayHi = function () {
  6.   alert('hello')
  7. }
  8.  
  9. let cat = new Animal ('cat');