"hello world" 'good bye, world!' "1600 Pennsylvania Avenue" '$*&[email protected] it!'
If you are using single quotes in your string, and you need to embed a single quote to write out a contraction, you use the backslash character (
js> 'can't' typein:1:5 SyntaxError: unexpected token: identifier: typein:1:5 'can't' typein:1:5 .....^
The interpreter can’t figure out what to do with the ‘t’ after the single quote.
Now watch what happens when we escape the single quote:
js> 'can\'t' "can't"
The escape character tells the interpreter to treat the single quote as an apostrophe and not as an “end-of-string” character.
You can embed other characters into a string, including the newline character (
\n) and the tab character (
\t). Here are some examples using the shell:
js> print("Hello, \n world!"); Hello, world! js> print("Hello, \tworld"); Hello, world
Although we still talk about programming as a standalone career, the dominance of technology in our lives makes it clear that coding is much more than a career path. In my opinion, computer science is more than a college major or a high-paid job; it’s a skill, essential for thriving in a modern-day economy. Whether you work in healthcare, marketing, business, or other fields, you will see more coding and have to deal with a growing number of technologies throughout your entire life.
Emojify - Create your own emoji with Deep Learning. We will classify human facial expressions to filter and map corresponding emojis or avatars.