declarar una funcion javascript

JavaScript
function square(number) {
  return number * number;
}

Source

Also in JavaScript: