boolean() in JavaScript?

Trying to figure out how to do this in JS

boolean enemyInRange() {
  enemies = GameObject.FindGameObjectsWithTag("team2"); 
  if(enemies.Length > 0) {
        targetEnemy = enemies[0];
        var dist = Vector3.Distance(transform.position, enemies[0].transform.position);
 
        for(var i=0;i<enemies.Length;i++) {
            var tempDist = Vector3.Distance(transform.position, enemies*.transform.position);*

if(tempDist < dist) {
targetEnemy = enemies*;*
Debug.Log("Distance from enemy: "+tempDist);
}
}
}

if(tempDist < 5) {
* return true;*
}
* return false;*
}
boolean EnemyInRange() { is how you do it in Java,C++,C#, ETC… guess it’s a bit different in “UnityScript”
: ‘boolean’ is not a valid macro

You don’t need the return type on the function - you can just declare it using function and return the boolean type. Not sure if #pragma strict requires the types on functions or not, but it looks like you declare the type after the function declaration, like so:

function enemyInRange() : bool
{
}