Ad
  • Custom User Avatar

    Here, [-1,1] is the array and this [g=="boy"] indicates the position of the array to be taken based on the condition. If the gender = "boy", then [-1, 1][1] would return 1 as the condition is true and if the gender = "girl", then [-1, 1][0] would return -1 as the condition is false. Basically, it is a [array][position] arrangement.