Skip to content

Commit deaae45

Browse files
committed
readme.md modified
1 parent bc057a5 commit deaae45

File tree

2 files changed

+45
-6
lines changed

2 files changed

+45
-6
lines changed

03-concationation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let fullName = firstName + " " + lastName; // concatination, merging to string t
55
console.log(fullName);
66

77

8-
var personInfoOne = fullName + ".I am " + age + ". I live in " + country; // ES5
9-
var personInfoTwo = `I am ${fullName}.I am ${age}. I live in ${country}`; //ES6 - String interpolation method
8+
let personInfoOne = fullName + ".I am " + age + ". I live in " + country; // ES5
9+
let personInfoTwo = `I am ${fullName}.I am ${age}. I live in ${country}`; //ES6 - String interpolation method
1010
console.log(personInfoOne);
1111
console.log(personInfoTwo);

readMe.md

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ programming language for four consecutive years and is the most used programming
3232
Github
3333
## Setup
3434
First thing first, lets install text or code editor. Install code editor, it could be [vscode](https://code.visualstudio.com/), [atom](https://atom.io/), [bracket](http://brackets.io/), [notepad++](https://notepad-plus-plus.org/) or others. I recommend vscode.
35+
Install either [Chrome](https://www.google.com/chrome/) or [Firefox](https://www.mozilla.org/en-US/firefox/new/?v=b) if you didn't have yet.
3536
## Adding JavaScript to a web page
3637
JavaScript can be added to a web pages in three ways:
3738
* ***Inline script***
@@ -145,11 +146,49 @@ In JavaScript and also other programming languages there are different kinds of
145146
Strings are text which are under ***single*** or ***double*** quote.
146147
Lets' see some examples of string:
147148
```js
148-
let firstName = 'Asabeneh'
149-
let country = 'Finland'
150-
let city = 'Helsinki'
151-
let language = 'JavaScript'
149+
let firstName = 'Asabeneh';
150+
let lastName = 'Yetayeh';
151+
let country = 'Finland';
152+
let city = 'Helsinki';
153+
let language = 'JavaScript';
154+
let job = 'teacher'
152155
```
156+
#### String Concatination
157+
```js
158+
// Declaring different variables of different data types
159+
let firstName = 'Asabeneh';
160+
let lastName = 'Yetayeh';
161+
let country = 'Finland';
162+
let city = 'Helsinki';
163+
let language = 'JavaScript';
164+
let job = 'teacher'
165+
166+
let fullName = firstName + " " + lastName; // concatination, merging to string together.
167+
console.log(fullName);
168+
169+
170+
let personInfoOne = fullName + ".I am " + age + ". I live in " + country; // ES5
171+
let personInfoTwo = `I am ${fullName}.I am ${age}. I live in ${country}`; //ES6 - String interpolation method
172+
let personInfoThree = `I am ${fullName}. I live in ${country}, ${city}. I am a ${job}. I teach ${language}.`
173+
console.log(personInfoOne);
174+
console.log(personInfoTwo);
175+
//More Examples
176+
var gravity = 9.81;
177+
var boilingPoint = 100;
178+
var bodyTemp = 37;
179+
180+
/*
181+
The boiling point of water is 100 oC.
182+
Human body temperatue is 37 oC.
183+
The gravity of earth is 9.81 m/s2.
184+
*/
185+
console.log(`The boiling point of water is ${boilingPoint} oC.\nHuman body temperatue is ${body} oC.\nThe gravity of earth is ${gravity} m / s2.`
186+
);
187+
188+
189+
```
190+
191+
153192
#### Exercises:String
154193
1. Declare a variable name company and assign it to an initial value **"Coding Academy"**.
155194
1. Print the string on the browser console using *console.log()*

0 commit comments

Comments
 (0)