Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js

Working with strings

 

Strings are a different data type. Strings is a series of symbols added together. These symbols can be anything, letters, special  characters and even numbers. A string is initiated by being inside quotes (' ').

It doesn't matter if they are single or double quotes, as long as you stick to the rule that you use as a closing quote, the same type that you used as an opening quote. Whatever lies inside the quotes will be printed exactly as it is. #what_you_see_is_what_you_get

 

Print 5 strings as they are to the console.

Then print strings that represent a math operation inside the quotes? What can you tell? Do you see the result of the operation or the string itself?

 

Attention! Try the string concatenation '+' operator. Is there any difference when working with numbers and when working with strings? Why?

Print 3 times an addition between:

1) A number and a number

2) A String and a number

3) A string and a string

 

What are the results?