Javascript, you’ve got to love it

In almost all computer languages a string is just a list of characters, like this sentence.

Strings in Javascript are fun!

The toString() method and the function String(..) both convert a number to a string.
With x = 12.3 and y=10000000

String(x)*2 gives 24.6
String(x)/String(y) gives 0.00000123
String((100 + 23).toString()-((-1)*String(x))) gives 135.3
(100 + 23).toString()+String(x) gives 12312.3

Work it out !!!!

Leave a comment

Filed under javascript, programming languages

My wordpress emails suddenly disappeared last night ??????

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

You are commenting using your 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 )

Connecting to %s