JavaScript Sandbox

In this example below you will see how to do a JavaScript Sandbox with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by 0degreesk, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright 0degreesk ©
  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>JavaScript Sandbox</title>
  
  
  
  
  
</head>

<body>

  
  
  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/0degreesk/javascript-sandbox-NMWBLy */
var str = "Robbie Andrew Schneider";
var arr = str.toLowerCase().split("");
console.log(str.match(/[aeiou]/gi).length);

var num = 5.56789;
var n = num.toFixed(3);
console.log(Math.PI.toFixed(4));

const myPi = n => Number(Math.PI.toFixed(n));

console.log(myPi(3));

Comments