daily pastebin goal
96%
SHARE
TWEET

Untitled

a guest Jul 12th, 2018 61 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.  
  4. describe('unicode strings', () => {
  5.  
  6.   it('are \\u prefixed', () => {
  7.     const nuclear = '\u2622'; //added '' around \u2622
  8.     assert.equal(nuclear, '☢');
  9.   });
  10.  
  11.   it('value is 4 bytes/digits', () => {
  12.     const nuclear = '\u2622'; //there were extra 2 (in the past u26222)
  13.     assert.equal(`no more ${nuclear}`, 'no more ☢');
  14.   });
  15.  
  16.   it('value is hexadecimal', () => {
  17.     const nuclear = '\u006E\u006F more \u2622';
  18.     //changed u006B to u006E and u006A to u006F
  19.     assert.equal(nuclear, 'no more ☢');
  20.   });
  21.  
  22.   it('curly braces may surround the value', () => {
  23.     const nuclear = `\u{0000000006E}\u{00006F} more \u{2622}`;
  24.     //added curly braces around the number after u
  25.     assert.equal(nuclear, 'no more ☢');
  26.   });
  27.  
  28. });
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