Nesting function inside Arrow function

Tell us what’s happening:
I am having trouble understanding how to nest another function within an arrow function . I think that my variable squarelist is a function that takes arr as an argument and returns squaredIntegers, which is an array the squares of all integers in realNumberArry.

Can someone explain why this isn’t working?


Your code so far

const realNumberArray = [4, 5.6, -9.8, 3.14, 42, 6, 8.34];
const squareList = (arr) => {
  "use strict";
  // change code below this line
  const squaredIntegers = [];
  for (i=0, i<arr.length, i++){
    if (i%2==0){
  // change code above this line
  return squaredIntegers;
// test your code
const squaredIntegers = squareList(realNumberArray);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36.

Link to the challenge:

Your code have a few syntax issues and typos which are causing problems.

#1) You need to review how to create a for loop. The following is not valid syntax:

  for (i=0, i<arr.length, i++){

#2) The following line of your if statement code block refers to a variable named squared, but you never defined what squared is.