index.js
function isPrime (n) {
  if (n === 1) return false
  if (n === 2) return true

  var m = Math.sqrt(n)

  for (var i = 2; i <= m; i++) if (n % i === 0) return false

  return true
}
function isPrime (n) {
  if (n === 1) return false
  if (n === 2) return true

  var m = Math.sqrt(n)

  for (var i = 2; i <= m; i++) if (n % i === 0) return false

  return true
}
function isPrime ( n ) { if ( n === 1 ) return false if ( n === 2 ) return true var m = Math . sqrt ( n ) for ( var i = 2 ; i <= m ; i ++ ) if ( n % i === 0 ) return false return true }
Check if a number is prime

@param {Number} n

@returns {Boolean}
Check if a number is prime