So, initially I was struggling to use Arrow Functions, and now I find that it’s difficult to write a solution to the challenges without writing the whole code block to solve the challenges. For instance:
/*function sliceArray(anim, beginSlice, endSlice) {
// Add your code below this line
return anim.slice(beginSlice, endSlice);
// Add your code above this line
}*/
let sliceArray = (anim, beginSlice, endSlice) => anim.slice(beginSlice, endSlice);
var inputAnim = ["Cat", "Dog", "Tiger", "Zebra", "Ant"];
sliceArray(inputAnim, 1, 3);
console.log(sliceArray(inputAnim, 1, 3));
I find the arrow function syntax much easier to comprehend and work with, so much so that the regular syntax is throwing me off, although it may be an issue with not writing the whole block. Is this normal? Did/does anyone else experience this? If it’s a negative, does anyone have any suggestion on how to fix it?
Thanks in advance.