Guest User

Untitled

a guest
Jan 22nd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. // 17: unicode - in strings
  2. // To do: make all tests pass, leave the assert lines unchanged!
  3. // Follow the hints of the failure messages!
  4.  
  5. describe('Unicode in strings', () => {
  6. it('are prefixed with `\\u` (one backslash and u)', () => {
  7. const nuclear = '\u2622';
  8. assert.equal(nuclear, '☢');
  9. });
  10. it('value is 4 bytes/digits', () => {
  11. const nuclear = '\u2622';
  12. assert.equal(`no more ${nuclear}`, 'no more ☢');
  13. });
  14. it('even "normal" character`s values can be written as hexadecimal unicode', () => {
  15. const nuclear = `\u006E\u006F more \u2622`;
  16. assert.equal(nuclear, 'no more ☢');
  17. });
  18. it('curly braces may surround the value', () => {
  19. const nuclear = `\u{006E}\u{006F} more \u2622`;
  20. assert.equal(nuclear, 'no more ☢');
  21. });
  22. });
Add Comment
Please, Sign In to add comment