Javascript Array first(array)

Description

Javascript Array first(array)


// your code here

// as Array is a class, then adding new functions to its prototype can be done by using the .fn
Array.prototype.first = function (array){
 return array[0];
};

Javascript Array first(array)

Array.prototype.first = function(array) {
 return array[0];
};



PreviousNext

Related