What is this JavaScript construct: “ = [y for each …]”

myColl.y = [y for each (y in myColl.y) if (y != myThing.getY())];

I understand what this is doing, returning all the ‘y’ items that are not the current one…

But, what is the concept called here with the brackets?
I would like to read up on what this is , syntax, etc.

  • Rules for the use of angle brackets in Typescript
  • Curly Brakets in Es2015
  • Curly Brackets in Arrow Functions
  • JavaScript: comma after opening bracket of parameter in syntax example
  • Mismatched parentheses: a quick way to find them?
  • Why () are needed in this Javascript code block?
  • use brackets in checkbox name when using php and javascript?
  • JavaScript: comma after opening bracket of parameter in syntax example
  • JavaScript regex get all numbers but exclude all between brackets
  • Understanding the Context of Curly Brackets '{}'
  • Why () are needed in this Javascript code block?
  • Curly Brackets in Arrow Functions
  • One Solution collect form web for “What is this JavaScript construct: “ = [y for each …]””

    It’s an array comprehension.

    Apparently this was introduced in Javascript 1.7.