Created
January 3, 2018 06:12
-
-
Save hanmd82/6207d68ee4bb8a478fd32aa40a4adefe to your computer and use it in GitHub Desktop.
ES6 katas for Unicode - http://es6katas.org/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 17: unicode - in strings | |
describe('unicode strings', () => { | |
it('are \\u prefixed', () => { | |
const nuclear = `\u2622`; | |
assert.equal(nuclear, '☢'); | |
}); | |
it('value is 4 bytes/digits', () => { | |
const nuclear = '\u2622'; | |
assert.equal(`no more ${nuclear}`, 'no more ☢'); | |
}); | |
it('value is hexadecimal', () => { | |
const nuclear = `\u006E\u006F more \u2622`; | |
assert.equal(nuclear, 'no more ☢'); | |
}); | |
it('curly braces may surround the value', () => { | |
const nuclear = `\u{0000000006E}\u{00006F} more \u2622`; | |
assert.equal(nuclear, 'no more ☢'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment