score:0

Accepted answer

With a quick google on Javascript If statments I beleive I have got there - thanks Bjorn :0) Your answer led me to get there !!!

// push data points
$(series).find('data point').each(function(i, point) {
    var floatVal = parseFloat($(point).text());
            if (!isNaN(floatVal)) {
                seriesOptions.data.push(floatVal);
        }
        else {
        seriesOptions.data.push(null);
        }
        console.log(floatVal)
    });

score:1

A null check in JavaScript if just like any other C-style language:

 if (thing == null) 

Or

 if (thing != null)

I find this works well in most cases against my own programming where I'm writing as I would in, say, C#; however I find other peoples code relies on things never having been declared or set and such and so, and, all in all, it boils down to a spaghetti of checking for null and "undefined" - yes, the literal string, really - and whatever else.

score:8

Well, parseFloat will return 'NaN' if it's not a number (null and undefined are NaNs) so you could try doing like this:

// push data points
$(series).find('data point').each(function(i, point) {
    var floatVal = parseFloat($(point).text());
    if (!isNaN(floatVal)) {
        seriesOptions.data.push(floatVal);
    }
});

Related Query

More Query from same tag