JSFiddle - React, Tailwind, and code Playground

JavaScript

function A() {}
A.prototype.x = 10;

var a = new A();
alert(a.x); // 10

A.prototype = {
  x: 20,
  y: 30
};

alert(a.y) // undefined

var b = new A();

alert(b.y) // undefined