Trying to translate C# To Js, A little help plz

Hi Lady s and gentle fish, I am a pretty shoddy coder. I know what i have to do, just don’t understand the languages. Someone yesterday helped me on here with abit of code, but was in C# so does anyone think they can translate.

The code is going to scan the scene for objects with tags. then see how many objects with tags there are.

GameObject[] npcs = GameObject.FindGameObjectsWithTag("NPC");
int numberOfNPCS = npcs.Length;

try this

var npcs :GameObject;

var numberOfNPCS :int;

npcs = GameObject.FindGameObjectsWithTag(“NPC”);

numberOfNPCS = npcs.Length;