Files
30-seconds-of-code/test/extendHex/extendHex.js
2018-01-09 06:09:49 -05:00

7 lines
123 B
JavaScript

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