index.js
/**
 * first: check to see if the number is in an array bringing out the number of elements needed, or 
 *      [], or first element in array
 * 
 * @param {Array} array: The array being tested
 * @param {number} number: The number used to test if its a number in an array
 * 
 * @return {array}: if the number given is a negative it will return an empty array 
 * @return {array}: if number is not given or not a number it will return the first element in the array
 * @return {array}: if number given is greater than the array's length it will return whole array
 * @return {array}: will return an array's elements up to the given number it will return the modified array
 */
check to see if the number is in an array bringing out the number of elements needed, or
[], or first element in array

@param {Array} array: The array being tested
@param {number} number: The number used to test if its a number in an array

@return {array}: if the number given is a negative it will return an empty array
@return {array}: if number is not given or not a number it will return the first element in the array
@return {array}: if number given is greater than the array's length it will return whole array
@return {array}: will return an array's elements up to the given number it will return the modified array
check to see if the number is in an array bringing out the number of elements needed or [] or first element in array @param { Array } array : The array being tested @param { number } number : The number used to test if its a number in an array @return { array } : if the number given is a negative it will return an empty array @return { array } : if number is not given or not a number it will return the first element in the array @return { array } : if number given is greater than the array ' s length it will return whole array @return { array } : will return an array ' s elements up to the given number it will return the modified array
function first(array, number){
    if(!Array.isArray(array) || number < 0){
        return [];
    }
    return number === undefined ? array[0] : array.slice(0,number);
}
function first ( array , number ) { if ( ! Array . isArray ( array ) || number < 0 ) { return [ ] ; } return number === undefined ? array [ 0 ] : array . slice ( 0 , number ) ; }
first: check to see if the number is in an array bringing out the number of elements needed, or
      [], or first element in array
first : check to see if the number is in an array bringing out the number of elements needed or [] or first element in array