Skip to content
Advertisement

If statement getting Skipped in a Function

I have defined a function that takes three entries, 2 numbers and an array. The Array is a 800 row 10 col array.

The first column in the array has a number for a state (target_province)

What I want the function to do is go row by row and assign the column data for each province to an empty array and return it.

However it looks like the if statement is getting skipped. Did i use the wrong syntax?

JavaScript

Advertisement

Answer

the value read from files is String type by default. You are comparing lets say string ‘1’ and int 1.

use this instead

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement