-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstrings.js
35 lines (27 loc) · 860 Bytes
/
strings.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Strings are a datatype used to represent
// text and are wrapped in either a single or double quotes
// We learned that strings are used to represent text
// turn any primitive data type into a string
// by adding single or double quotes
var greeting = "it's good to meet you!";
greeting.length;
// challange
/*
var animal = 'horse";
var answer = false;
*/
// valid strings
var animal = 'horse';
var answer = 'false';
var greeting1 = 'Sam says, "hi."';
greeting1;
// "Sam says, "hi.""
var greeting2 = "It's great to see you!";
greeting2;
// "It's great to see you!"
var greeting3 = 'Don\'t forget to grab the newspaper\n on your way out. You are goin to be\n on the bus for a long time because of traffic.';
greeting3;
/*"Don't forget to grab the newspaper
on your way out. You are goin to be
on the bus for a long time because of traffic."
*/