Technical Challenges

The Square of a number

var square = function(x, y) {
  y = x;
  return x * y;
};

console.log(square(8));

Exponential

//Write a function that calculates x to the power of z

function power(num, exp) {
  var value = num;

  for (var i = 1; i < exp; i = i + 1) {
    value = value * num;
    //Keeps a running total
  }
  return value;
}

var value = power(2, 3);
console.log(value);

// A loop is exactly like an exponent or multipliying a
// number by itself for a certain amount of times.
// a loop executes one of more statements for a certain amount
// of times.

Reverse a string

Multiply Array

Date

Eliminate Duplicates

Find the remainder of a number

x - (z * y ) x - zy = remainder

Last updated

Was this helpful?