JSFiddle - React, Tailwind, and code Playground

by Alexandre Simoes

JavaScript

var xCount;
var x = function(){};

var y = new Object();
var z = [];

Object.prototype.mySpecialProperty= true;

x = x.constructor;
for (xCount = 1; xCount < 100 && x == x.constructor; xCount++)
{
   x = x.constructor;
}

// I broke the evaluation to see them separately
console.log("Result of five tests on prototypes and inheritance: ");
console.log(xCount == 100);
console.log(Object.getPrototypeOf(Object.getPrototypeOf(y)) == null);
console.log(Object.getPrototypeOf(Object.getPrototypeOf(z)) === Object.prototype);
console.log(Object.getPrototypeOf(Object.getPrototypeOf(Object.getPrototypeOf(z).constructor)) === Object.prototype);
console.log(x.mySpecialProperty);
console.log(y.mySpecialProperty);
console.log(z.mySpecialProperty);