Files
30-seconds-of-code/test/extendHex/extendHex.js
2018-08-02 13:49:33 +03:00

9 lines
173 B
JavaScript

const extendHex = shortHex =>
'#' +
shortHex
.slice(shortHex.startsWith('#') ? 1 : 0)
.split('')
.map(x => x + x)
.join('');
module.exports = extendHex;