S
S
Sergey Shilov2017-06-12 16:37:26
JavaScript
Sergey Shilov, 2017-06-12 16:37:26

What is grunt complaining about?

Good afternoon! The project is not going, gives an error. Says, they say, a syntax error
75980723af4a43018e97ac59bc4b9a8c.PNG
Here is a piece of code, at the beginning of which, apparently, there is an error:

function extractNodeLevel(level, twoLevels = true){
    if(layouts[0]){
      if(!layouts[0][level]){
        return null;
      }
    } else {
      return null;
    }
    var nodes1 = [];
    if(layouts[0][parseInt(parseInt(level) + 1)] && twoLevels){
      var nodes2 = [];
      for(var layout in layouts){
        nodes1.push(layouts[layout][parseInt(level)]);
        nodes2.push(layouts[layout][parseInt(parseInt(level) + 1)]);
      }
      return {nodes1:nodes1, nodes2:nodes2};
    } else {
      for(var layout in layouts){
        nodes1.push(layouts[layout][parseInt(level)]);
      }
      return {nodes1:nodes1};
    }	
    
  }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Negwereth, 2017-06-12
@Negwereth

your uglyfire about ES6 is not up to date

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question