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
Post a Comment