Chuck's video

argon blue
Tera Contributor

var a = 3
var b = 3

if (a < b) {
gs.info('a is less than b');
}       else if (a > b) {
        gs.info('a is greater than b');
}       else { 
       gs.info('it looks like a is equal to b');
}

 

 

Returns:  

*** Script: a is greater than b

 

Suppose to return :  

*** Script: it looks like a is equal to b



 This is on Chuck's lesson 11 video Can't see where i'm going wrong ?

Learn JavaScript on the Now Platform: Lesson 11 -The If statement and Boolean logic (youtube.com)

2 ACCEPTED SOLUTIONS

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @argon blue 

 

I am getting the expected results. I just copy pasted the script.

 

LearnNGrowAtul_0-1702311198576.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

View solution in original post

Sandeep Rajput
Tera Patron
Tera Patron

@argon blue Are you sure about the output, as I ran the same script and it shows the output 

*** Script: it looks like a is equal to b

 Screenshot 2023-12-11 at 9.45.53 PM.png

View solution in original post

2 REPLIES 2

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @argon blue 

 

I am getting the expected results. I just copy pasted the script.

 

LearnNGrowAtul_0-1702311198576.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Sandeep Rajput
Tera Patron
Tera Patron

@argon blue Are you sure about the output, as I ran the same script and it shows the output 

*** Script: it looks like a is equal to b

 Screenshot 2023-12-11 at 9.45.53 PM.png