Why we use empty string

Community Alums
Not applicable

Hi All,

 

Greetings!

 

Why we add empty string, I have come across multiple times but never understood the meaning. Please help me to understand below highlighted part. Why we used +'' here.

Tejas12_0-1672477399632.png

 

Thanks,
Tejas

 

2 REPLIES 2

Sagar Pagar
Tera Patron

Hi,

Can you share the complete scripts for better understanding.

 

Thanks,

Sagar Pagar 

The world works with ServiceNow

Taha Habib
Tera Guru

Hello Tejas,

I have seen people most of the time using this syntax to convert the type to string.

It works similar to "variable.toString()."

I hope this information helps you. Thank you.