Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<script>
"use strict";
  const decoder = new TextDecoder();
  const encoder = new TextEncoder();
  
  const ta = encoder.encode("hello");
  console.log(ta.length);
  window.postMessage(ta, "*", [ta.buffer]);
  console.log(ta.length);
  
  const result = decoder.decode(ta.buffer);
  console.log(result);
</script>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
domenicpro
0viewers