mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
Transform 'var' in 'let'
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
var caesar = function() {
|
let caesar = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var caesar = require('./caesar')
|
let caesar = require('./caesar')
|
||||||
|
|
||||||
describe('caesar', function() {
|
describe('caesar', function() {
|
||||||
it('works with single letters', function() {
|
it('works with single letters', function() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var calculator = require ('./calculator.js');
|
let calculator = require ('./calculator.js');
|
||||||
|
|
||||||
describe('add', function() {
|
describe('add', function() {
|
||||||
it('adds 0 and 0', function() {
|
it('adds 0 and 0', function() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var fibonacci = function() {
|
let fibonacci = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var fibonacci = require('./fibonacci')
|
let fibonacci = require('./fibonacci')
|
||||||
|
|
||||||
describe('fibonacci', function() {
|
describe('fibonacci', function() {
|
||||||
it('works', function() {
|
it('works', function() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var <%= title %> = function() {
|
let <%= title %> = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var <%= title %> = require('./<%=title%>')
|
let <%= title %> = require('./<%=title%>')
|
||||||
|
|
||||||
describe('<%=title%>', function() {
|
describe('<%=title%>', function() {
|
||||||
it('EDITME', function() {
|
it('EDITME', function() {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ This setup should be the same for all of the exercises. The plain javascript fi
|
|||||||
|
|
||||||
Let's look at the spec file first:
|
Let's look at the spec file first:
|
||||||
```javascript
|
```javascript
|
||||||
var helloWorld = require('./helloWorld');
|
let helloWorld = require('./helloWorld');
|
||||||
|
|
||||||
describe('Hello World', function() {
|
describe('Hello World', function() {
|
||||||
it('says hello world', function() {
|
it('says hello world', function() {
|
||||||
@@ -26,7 +26,7 @@ For now you do not need to worry about how to write tests, but you should try to
|
|||||||
|
|
||||||
so let's look at the javascript file:
|
so let's look at the javascript file:
|
||||||
```javascript
|
```javascript
|
||||||
var helloWorld = function() {
|
let helloWorld = function() {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ Just to make sure, in case you're confused at this point, the test is telling yo
|
|||||||
|
|
||||||
this is what the final function should look like:
|
this is what the final function should look like:
|
||||||
```javascript
|
```javascript
|
||||||
var helloWorld = function() {
|
let helloWorld = function() {
|
||||||
return 'Hello, World!'
|
return 'Hello, World!'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
var helloWorld = function() {
|
let helloWorld = function() {
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = helloWorld
|
module.exports = helloWorld
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var helloWorld = require('./helloWorld');
|
let helloWorld = require('./helloWorld');
|
||||||
|
|
||||||
describe('Hello World', function() {
|
describe('Hello World', function() {
|
||||||
it('says hello world', function() {
|
it('says hello world', function() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var leapYears = function() {
|
let leapYears = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var leapYears = require('./leapYears')
|
let leapYears = require('./leapYears')
|
||||||
|
|
||||||
describe('leapYears', function() {
|
describe('leapYears', function() {
|
||||||
it('works with non century years', function() {
|
it('works with non century years', function() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var palindromes = function() {
|
let palindromes = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var palindromes = require('./palindromes')
|
let palindromes = require('./palindromes')
|
||||||
|
|
||||||
describe('palindromes', function() {
|
describe('palindromes', function() {
|
||||||
it('works with single words', function() {
|
it('works with single words', function() {
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
// See https://en.wikipedia.org/wiki/Pig_Latin for more details.
|
// See https://en.wikipedia.org/wiki/Pig_Latin for more details.
|
||||||
|
|
||||||
var pigLatin = require("./pigLatin.js");
|
let pigLatin = require("./pigLatin.js");
|
||||||
|
|
||||||
describe('#translate', function() {
|
describe('#translate', function() {
|
||||||
it('translates a word beginning with a vowel', function() {
|
it('translates a word beginning with a vowel', function() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var removeFromArray = function() {
|
let removeFromArray = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var removeFromArray = require('./removeFromArray')
|
let removeFromArray = require('./removeFromArray')
|
||||||
|
|
||||||
describe('removeFromArray', function() {
|
describe('removeFromArray', function() {
|
||||||
it('removes a single value', function() {
|
it('removes a single value', function() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var repeatString = function() {
|
let repeatString = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var repeatString = require('./repeatString')
|
let repeatString = require('./repeatString')
|
||||||
|
|
||||||
describe('repeatString', function() {
|
describe('repeatString', function() {
|
||||||
it('repeats the string', function() {
|
it('repeats the string', function() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var reverseString = function() {
|
let reverseString = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var reverseString = require('./reverseString')
|
let reverseString = require('./reverseString')
|
||||||
|
|
||||||
describe('reverseString', function() {
|
describe('reverseString', function() {
|
||||||
it('reverses single word', function() {
|
it('reverses single word', function() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var snakeCase = function() {
|
let snakeCase = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var snakeCase = require('./snakeCase')
|
let snakeCase = require('./snakeCase')
|
||||||
|
|
||||||
describe('snakeCase', function() {
|
describe('snakeCase', function() {
|
||||||
it('works with simple lowercased phrases', function() {
|
it('works with simple lowercased phrases', function() {
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
var sumAll = function() {
|
let sumAll = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var sumAll = require('./sumAll')
|
let sumAll = require('./sumAll')
|
||||||
|
|
||||||
describe('sumAll', function() {
|
describe('sumAll', function() {
|
||||||
it('sums numbers within the range', function() {
|
it('sums numbers within the range', function() {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
var ftoc = function() {
|
let ftoc = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var ctof = function() {
|
let ctof = function() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
var {ftoc, ctof} = require('./tempConversion')
|
let {ftoc, ctof} = require('./tempConversion')
|
||||||
|
|
||||||
describe('ftoc', function() {
|
describe('ftoc', function() {
|
||||||
it('works', function() {
|
it('works', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user