JS Array Extension - 50 точки
https://pastebin.com/yZvZwLAC - код
1. Array Extension
Extend the build-in Array object with additional functionality. Implement the following functionality:
- - returns the last element of the array
- - returns a new array which includes all original elements, except the first n elements; n is a Number parameter
- - returns a new array containing the first n elements from the original array; n is a Number parameter
- - returns a sum of all array elements
- - returns the average of all array elements
Input / Output
Input for functions that expect it will be passed as valid parameters. Output from functions should be their return value.
Constraints
Structure your code as an IIFE.
https://judge.softuni.bg/Contests/Compete/Index/1677#0
Условието беше с грешка поради използването на arrow функции ! .. До 50 точки я докарах и не знам.. 2и и 3и тест гърмят !
(Unexpected error: Incorrect average value: expected NaN to equal 2);
Благодаря предварително :)
Благодаря много ! : )