Javascript: Working with Strings

Working with strings in Javascript is very simple. You need to put the string in double quotes or single quotes

"Joys of Programming"
'Programming made simpler and easier'

Now if you want to use them, you can simply use them in variables.

var site_name = "Joys of Programming";

Let’s same operations like concatenation (+)

site_name = site_name + ": Programming made easier and joyful"
"Joys of Programming: Programming made easier and joyful"

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s