ecmatrip
v1.0.10
Published
Prank your friends and colleagues by making javascript native methods very unpredictable!
Downloads
16
Readme
EcmaTrip
If you feel like pulling a prank on your friends and colleagues this is the perfect package
Installing
Install it onto a project that a friend or colleague are working on and watch them cry out loud trying to debug it :D
npm i ecmatrip --save
Usage Examples
require("ecmatrip");
You can also download the index.js file and import it into your HTML
<script type="text/javascript" src="path-to-javascript-file.js"></script>
"Blue House".includes("blue"); // returns true or false (random);
var animals = ["dog", "cat"];
animals.push("bird"); // The array will look like: ["bird", "dog", "cat"]
// (unshifts instead of pushing and vice versa)
How it works
This package leverages the power of prototypal inheritance in JavaScript to change the default behavior of native String and Array methods
Supported methods:
// Strings
String.prototype.startsWith;
String.prototype.endsWith;
String.prototype.includes;
String.prototype.charAt;
String.prototype.slice;
String.prototype.charCodeAt;
String.prototype.lastIndexOf;
// Arrays
Array.prototype.pop;
Array.prototype.shift;
Array.prototype.unshift;
Array.prototype.push;
Array.prototype.slice;
Array.prototype.splice;
Array.prototype.join;
// More will be added in the future
All those methods had their functionality slightly changed to be imprecise and create chaos
Authors
- Valentino Patoleia - Initial work - Github
License
This project is licensed under the MIT License - see the LICENSE.md file for details