title: How do I swap endian-ness (byte order) of a variable in javascript
body: <p>I am receiving and sending a decimal representation of two little endian numbers. I would like to:</p>
  
  <ul>
  <li>shift one variable 8 bits left</li>
  <li>OR them</li>
  <li>shift a variable number of bits</li>
  <li>create 2 8 bit numbers representing the first and second half of the 16 bit number.</li>
  </ul>
  
  <p>javascript (according to <a href="https://developer.mozilla.org/en/JavaScript/Reference/Operators/Bitwise_Operators" rel="noreferrer">https://developer.mozilla.org/en/JavaScript/Reference/Operators/Bitwise_Operators</a>) uses big endian representation when shifting...</p>
  
  <p>endianness is a bit foreign to me (I am only 90 percent sure that my outlined steps are what i want.) so swapping is a bit dizzying. please help! I only really need to know how to swap the order in an efficient manner. (I can only think of using a for loop on a toString() return value)</p>