Ad
Mathematics

A simple calculator, with an identifier string "calc", x, and y.
Make sure to add the right strings, with 3 letters each.

function calculator(calc,x,y){
  if(!calc||!x||!y) return false;
  if(calc == "add") return x+y;
  if(calc == "sub") return x-y;
  if(calc == "tms") return x*y;
  if(calc == "div") return x/y;
  if(calc == "pwr") return x**y;
  return false;
}
Fundamentals
Mathematics
Tutorials

Simple, but it might be good for the basics.

Hint: 'Number's are good for 'Math'.

function isSquare(n){
  return Number.isInteger(Math.sqrt(n));
}
Fundamentals
Mathematics
function isDivisible(a,n){
  return a%n == 0;
}