JSFiddle - React, Tailwind, and code Playground

by Saurabh Khemka

HTML

Inheritance

JavaScript

/* const arr = [10, 12, 15, 21];
for (var i = 0; i < arr.length; i++) {
setTimeout(function() {
console.log('Index: ' + i + ', element: ' + arr[i]);
}, 3000); } */



/* function Animal(name) {
this.name=name; 
}

function Dog(name, bark) {
console.log(this)
  Animal.call(this, name);
  this.bark = bark;
}  */

var Animal = (name) => {
console.log(this)
  this.name=name; 
}

console.log(Animal())

var Dog = (name, bark) => {

  //Animal.call(this);
  this.bark = bark; 
} 

/* Dog.prototype = Object.create(Animal.prototype);
Dog.prototype.constructor = Dog; */

/* var d  = new Dog('test1', true);
console.log(d) */

/* onClick={this.onSubmit}

onClick={this.onSubmit.bind(this)} */