CSCI-4830-002-2014 / challenge-week-5

0 stars 15 forks source link

Removing NaN? #13

Closed alne4294 closed 10 years ago

alne4294 commented 10 years ago

When I created a text file from the olympic data, I get the following:

... 20, 39, 28, 29, 32, 17, 21, 31, 23, NaN ]

Does anyone have any strategies for removing the NaN from '\n' separated data? I used gauss> data = data.map(function(line){return parseInt(line)}); for the comma-separated data.txt file, but I'm a little stuck for this one. Thanks :)

alne4294 commented 10 years ago

Got it! If anyone has the same issue, check out the "splice" function. http://stackoverflow.com/questions/2528076/delete-a-line-of-text-in-javascript