JSFiddle - React, Tailwind, and code Playground
by Christian Sonne
HTML
<script id="es6">
let [a, b] = [42, 64];
console.log({
a,
b
});
</script>
JavaScript
var s1 = document.createElement("script");
s1.src = "https://unpkg.com/@babel/standalone/babel.min.js";
s1.onload = function() {
var out = Babel.transform(document.getElementById("es6").innerHTML, { presets: ['es2015'] }).code;
var s2 = document.createElement("script");
s2.innerHTML = out;
document.body.appendChild(s2);
}
document.body.appendChild(s1);