javascript - Two identical Strings that don't equal each other -


hi i'm having trouble comparing 2 strings should same when evaluate in alert(f==g) evaluates false.

var otrackcarriers = { "9045": [ ["a"], ["b"], ["c"] ], "9046": [ [" "]  ] }; var oheadingcarriers = { "ripplefold": [ ["a"], ["b"], ["c"], ["d"] ], "pinchpleat": [ ["c"], ["d"] ] }; var headinglist = oheadingcarriers["ripplefold"]; var tracklist = otrackcarriers["9045"] var f = (tracklist[0].valueof()); var g = (headinglist[0].valueof()); alert(f); alert(g); alert(f == g); 

is because i'm putting 2 values array beforehand?

here's running http://jsfiddle.net/sqrst/17/embedded/result/ help

["a"] array. can either string value tracklist[0][0] , headinglist[0][0] or check if every string contained in tracklist[0] , headinglist[0] equals. usually, 2 arrays differents when comparing them directly. in fact, array equal if memory addresses same, makes no sense.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -