Skip to content

Commit b783c09

Browse files
modify var to const keyword (#197)
I noticed the second edition of the book had the const keyword when creating variables for arrow functions. This has not been updated in the github repo so i decided to make these changes
1 parent 276a0bc commit b783c09

11 files changed

Lines changed: 11 additions & 11 deletions

File tree

chapter-02/03-arrow-functions/01-arrows.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1>Arrow Functions</h1>
1313

1414
// Regular Function
1515

16-
var lordify = function(firstname) {
16+
const lordify = function(firstname) {
1717
return `${firstname} of Canterbury`
1818
}
1919

chapter-02/03-arrow-functions/02-arrows.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1>Arrow Functions</h1>
1313

1414
// Arrow Function
1515

16-
var lordify = firstname => `${firstname} of Canterbury`
16+
const lordify = firstname => `${firstname} of Canterbury`
1717

1818
console.log( lordify("Dana") )
1919
console.log( lordify("Daphne") )

chapter-02/03-arrow-functions/03-arrows.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1>Arrow Functions</h1>
1313

1414
// Function
1515

16-
var lordify = function(firstName, land) {
16+
const lordify = function(firstName, land) {
1717
return `${firstName} of ${land}`
1818
}
1919

chapter-02/03-arrow-functions/04-arrows.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1>Arrow Functions</h1>
1313

1414
// Arrow Function
1515

16-
var lordify = (firstName, land) => `${firstName} of ${land}`
16+
const lordify = (firstName, land) => `${firstName} of ${land}`
1717

1818
console.log( lordify("Debbie", "Texas") )
1919
console.log( lordify("Daphne", "Susanville") )

chapter-02/03-arrow-functions/05-arrows.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1>Arrow Functions</h1>
1313

1414
// Function
1515

16-
var lordify = function(firstName, land) {
16+
const lordify = function(firstName, land) {
1717

1818
if (!firstName) {
1919
throw new Error('A firstName is required to lordify')

chapter-02/03-arrow-functions/06-arrows.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1>Arrow Functions</h1>
1313

1414
// Arrow Function
1515

16-
var lordify = (firstName, land) => {
16+
const lordify = (firstName, land) => {
1717

1818
if (!firstName) {
1919
throw new Error('A firstName is required to lordify')

chapter-02/03-arrow-functions/07-arrows.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1>Arrow Functions</h1>
1313

1414
// Function
1515

16-
var tahoe = {
16+
const tahoe = {
1717
resorts: ["Kirkwood","Squaw","Alpine","Heavenly","Northstar"],
1818
print: function(delay=1000) {
1919

chapter-02/03-arrow-functions/08-arrows.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1>Arrow Functions</h1>
1313

1414
// Function Solution with bind
1515

16-
var tahoe = {
16+
const tahoe = {
1717
resorts: ["Kirkwood","Squaw","Alpine","Heavenly","Northstar"],
1818
print: function(delay=1000) {
1919

chapter-02/03-arrow-functions/09-arrows.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1>Arrow Functions</h1>
1313

1414
// Arrow Function
1515

16-
var tahoe = {
16+
const tahoe = {
1717
resorts: ["Kirkwood","Squaw","Alpine","Heavenly","Northstar"],
1818
print: function(delay=1000) {
1919

chapter-02/03-arrow-functions/10-arrows.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1>Arrow Functions</h1>
1313

1414
// Arrow Functions gone too far, this means window
1515

16-
var tahoe = {
16+
const tahoe = {
1717
resorts: ["Kirkwood","Squaw","Alpine","Heavenly","Northstar"],
1818
print: (delay=1000) => {
1919

0 commit comments

Comments
 (0)