When i have to use single quote (' ') in scripts?

Ankit Kumar6
Tera Contributor

Hello Team,

I am really Confused when i have to exactly use Single quote (' ') in scripts.

like in client script if i don't use single quote with g_form Api's then the script will not work. But with g_user Api's if I don't use single quote then the scripts work perfectly.

 

Will anyone help me in clearing this confusion?

 

Also,please find my script attached below.

Thnaks

3 REPLIES 3

AndersBGS
Tera Patron
Tera Patron

Hi @Ankit Kumar6 ,

 

general JavaScript it shouldn’t matter if you use single or double quotes, you just need to be consisted. Furthermore, if there is single quote in a text string, then it will disrupt your script, hence double quotes would be the way to go.

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

Best regards

Anders

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/

Hi @AndersBGS

 

You are correct but my question is different.

My question is like when we are comparing value in if condition when we have to use single quotes and when we don't have to use. 

 

Thanks,

Ankit

thomaskennedy
Tera Guru

I'm sure you know not to do this, but - are you copying quotes in from somewhere else, such as MS Word?