title: How do we get from the two 16-bit code points used to represent a non-BMP character in UTF-16 to the single code point of the character in Unicode?
body: <p>In ES6, when we use <code>codePointAt(0)</code> on a string with one character in it ('') that has a Unicode code point value larger than U+FFFF (therefore not part of the Basic Multilingual Plane), we get the code point 134071. The string still actually has two code points in it, that represent this 134071 value.</p>
  
  <pre><code>&gt; (55362).toString(16)
  'd842'
  &gt; (57271).toString(16)
  'dfb7'
  &gt; "\ud842\udfb7"
  ''
  &gt; const j = "\ud842\udfb7"
  undefined
  &gt; j
  ''
  &gt; j.codePointAt(0)
  134071
  &gt; j.codePointAt(1)
  57271
  &gt;
  </code></pre>
  
  <p>My question is how do we go from the two code points 55362 and 57271 to the single code point 134071. I am talking about the mathematical relationship here.</p>
  
  <p>Also, why can we still get access to the code point at position 1, but we can't get access to the individual code point at position 0?</p>