Question: Write a JavaScript function on the following: a.) Create a function that to get the first or last element of an array. Passing a parameter

Write a JavaScript function on the following: a.) Create a function that to get the first or last element of an array. Passing a parameter 'n' that will return the first 'n' or last 'n' elements of the array. Function should also validate if the array has elements or the n parameter has a valid value. b.) Create a function which accept a number as input and insert asterisks(*) between each two even number. ie. 12550853426 = 12550*8534*2*6 - c.) Create a function to sort the items of an array (do not use an array method). Function should also evaluate negative valued integers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
