UNPKG

ds-algo-study

Version:

Just experimenting with publishing a package

9 lines (8 loc) 229 B
module.exports = function reverseString(string) { if (typeof string !== "string") { throw new TypeError( `reverseString requires a string not a ${typeof string}` ); } return [...string].reverse().join(""); };