JSFiddle - React, Tailwind, and code Playground

by Alexey

JavaScript

/* if (!Date.prototype.lastYear) {
  Date.prototype.lastYear = function() {
    return new Date(this).getFullYear() - 1;
  }
}

let a = new Date('2007-11-11').lastYear(); */
//console.log(a)


Array.prototype.map = function() {
  let x = this;
  for (let i = 0; i < x.length; i++) {
    x[i] = x[i] + 'x'
  }
  return this;
}

//Array.prototype.map.bind(null, )

let x = [1, 2, 3, 4, 5];

console.log(x.map());