Skip to content
This repository was archived by the owner on Aug 2, 2020. It is now read-only.

Latest commit

 

History

History
35 lines (25 loc) · 1.07 KB

README.md

File metadata and controls

35 lines (25 loc) · 1.07 KB

I Know I Shouldn't

A micro-library that contains snippets of code useful for modifying strings and arrays. While it does modify the native prototype of String and Array, it does so with non-enumerable methods.

Greenkeeper badge Latest Documentation

String.prototype.format

Returns a formatted string.

Character Type
s String
i Integer
d Digit
f Float
'rgba(%i, %i, %i, %f)'.format(255, 0, 0, 0.5);
'Hello %s'.format('World!');

Array.prototype.chunk

Split an array into smaller chunks.

[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].chunk(2);