daily pastebin goal
68%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top