Files
30-seconds-of-code/test/extendHex/extendHex.js
2018-01-17 13:40:40 -05:00

8 lines
152 B
JavaScript

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