Select Function problem

def alive_members if @inv_enemy.any? result = members.select{|member| member.alive? && !member.invisible?} if result.size.zero? invisible_enem super else result end else super end endhow can you interpret this in JavaScript / convert in JavaScript. This is placed under Game_Troop.

Also, how do you address the game troop enemies in Game Troop (JavaScript)?
You can use the filter function: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter

What do you mean with how to address game troop enemies?
You can use the filter function: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter

What do you mean with how to address game troop enemies?
I want to address the game troops just like in RGSS3, like this:

result = members.select{|member| member.alive? && !member.unselectable?}
Code:
members.each{|enemy| @unselectable_enemys << enemy.unselectable?}
notice that when we extract, we can have member and enemy inside members? I want to do that as well in MV.

EDIT:

Could you check what's wrong with my Filter?

Game_Troop.prototype.result;Game_Troop.prototype.invisibleMembers= function() { for (var x = 0; x < this.invisible_enemies.length; x++) { members.forEach(function(enemy, index, members) { if (enemy.isAlive() && enemy.invisible_enemy) { this.result = enemy; } }); if (this.result.size == 0) { this.invisible_enemy(); //super? } else { return this.result; } } // super?I left the //super comment because on the snippet I was trying to convert there was a super method. Is there an equivalent of super in JS?

Original thread: https://forums.rpgmakerweb.com/threads/select-function-problem.49001/