The CreatorCon Call for Content is officially open! Get started here.

Need some clarification on operator symbol

mahe
Kilo Contributor

I have 2 sets of statements

if(current.u_rca.nil() && current.u_rca_attached)

{

current.u_rca_attached = 'false' ;

This code is getting executed in a business rule where the condition is if u_rca_feild is nil and u_rca_attached field which is selected (Check box) on the incident form , the u_rca_attached field will also turn to false (uncheck) once we save the record , so my questions are

a) Can we use current.u_rca_attached === "true" in the above line ?

b) If no , why not ?   I tried using point a in the code but it did not work.

c) so is === operator means equal to or something else ?

d) does it have a different meaning in client script vs business rule ?

2 REPLIES 2

Anurag Tripathi
Mega Patron
Mega Patron

Thats my 2 cents here,



===   matches the type as well as value whereas == just matches the value


-Anurag

Aka Guglielmo
ServiceNow Employee
ServiceNow Employee

== and === are pretty similar, they are used in condition statement to check if a value is equal to another one



ie:


if (a==b)



= is used to assign a value to a variable



ie:


var a="hello";



cheers