Nevermind, I figured it out. Apparently the "=>" is a way to define functions. This is the resource I used if you also want to learn.
TheCool
@TheCool
2
Posts
678
Profile views
0
Followers
0
Following
Posts made by TheCool
-
RE: How exactly does {filter:} work?
-
How exactly does {filter:} work?
I'm a beginner, and in the tutorial, there is this part:
var targets = creep.room.find(FIND_STRUCTURES, { filter: (structure) => { return (structure.structureType == STRUCTURE_EXTENSION || structure.structureType == STRUCTURE_SPAWN) && structure.store.getFreeCapacity(RESOURCE_ENERGY) > 0; }
and it's really confusing me. I don't get what format they want, what the => is for, and why it needs to return a value. If someone could break down the components that'd be greatly appreciated!