main.js
1
2
3
4
5
function square(x) {
  const res = x * x;
  return res;
}
console.log(square(2)); // => 4
Native Browser JavaScript