mrvaskokurko mrvaskokurko - 1 year ago 97
Javascript Question

What does != mean in JavaScript?

I am mainly trying to figure out what this function is trying to say. For the most part I understand that the function is checking the variables and seeing if they are indeed variables. But what does != say in the script?

function fun2() {
var output = "";

if (typeof myGlobal != "undefined") {
output += "myGlobal: " + myGlobal;

if (typeof oopsGlobal != "undefined") {
output += " oopsGlobal: " + oopsGlobal;


Answer Source

The operator != means if is different for example red != blue it return true, you can check the documentation of expressions and operators here: Comparison_operators Dev Mozilla JS

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download