Quantcast
Channel: Pentaho Community Forums
Viewing all articles
Browse latest Browse all 16689

Javascript compare

$
0
0
This is some pretty basic Javascript stuff, but driving me a little crazy:

I have this simple code:
Code:

var pass_fail = "";

if (SRC_COUNT == DM_COUNT)
{
pass_fail = "PASS";
}
else
{
pass_fail = "FAIL";
};

When SRC_COUNT is equal to DM_COUNT, it ends up setting "FAIL" to the variable "pass_fail" If I use "=" instead of "==" it correctly writes "PASS" to the stream.

Shouldn't "==" be correct to use to compare two values? SRC_COUNT and DM_COUNT are two values passed from the stream and not variables in the javascript itself--does that make a difference?

Viewing all articles
Browse latest Browse all 16689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>