JSFiddle - React, Tailwind, and code Playground

by Ilya

JavaScript

let arr = [1, 2, 3];
arr.prototype.get = () => {
	return 'test'
}
/* arr = new Proxy(arr, {
  get(target, prop) {
    if (prop in target) {
      return target[prop]
    } else {
      return 0;
    }
  }
}); */

console.log(arr[1])
console.log(arr[123])