Skip to content

Commit fc6e83d

Browse files
committed
prettier applied to the files
1 parent 3fdce9e commit fc6e83d

5 files changed

Lines changed: 21 additions & 24 deletions

File tree

‎Sprint-3/1-key-errors/1.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ function convertToPercentage(decimalNumber) {
1616
console.log(decimalNumber); */
1717

1818
// =============> write your explanation here
19-
// We don't need to redeclare decimalNumber as it's value comes from function parameter,
20-
// also console.log wont work as decimalNumber is only created inside the function.
19+
// We don't need to redeclare decimalNumber as it's value comes from function parameter,
20+
// also console.log wont work as decimalNumber is only created inside the function.
2121

2222
// Finally, correct the code to fix the problem
2323
// =============> write your new code here

‎Sprint-3/1-key-errors/2.js‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
// Predict and explain first BEFORE you run any code...
32

43
// this function should square any number but instead we're going to get an error
@@ -18,7 +17,6 @@ function square(3) {
1817

1918
// =============> write your new code here
2019
function square(num) {
21-
return num * num;
20+
return num * num;
2221
}
23-
console.log(square(5))
24-
22+
console.log(square(5));

‎Sprint-3/3-mandatory-implement/1-bmi.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
// It should return a string of their Body Mass Index to 1 decimal place
1616

1717
function calculateBMI(weight, height) {
18-
let bmiNum = weight / (height * height)
19-
bmiNum=bmiNum.toFixed(1)
20-
return bmiNum
18+
let bmiNum = weight / (height * height);
19+
bmiNum = bmiNum.toFixed(1);
20+
return bmiNum;
2121
}
2222

23-
console.log(calculateBMI(70,1.73));
23+
console.log(calculateBMI(70, 1.73));

‎Sprint-3/3-mandatory-implement/2-cases.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
// Use the MDN string documentation to help you find a solution
1616
// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
1717

18-
const str= "hello there"
18+
const str = "hello there";
1919

2020
function strToUpperCase(str) {
21-
return str.toUpperCase().replaceAll(" ","_")
21+
return str.toUpperCase().replaceAll(" ", "_");
2222
}
23-
console.log(strToUpperCase("lord of the rings"));
23+
console.log(strToUpperCase("lord of the rings"));

‎Sprint-3/3-mandatory-implement/3-to-pounds.js‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
// You should call this function a number of times to check it works for different inputs
1414

15-
1615
/*
1716
const penceString = "399p";
1817
@@ -35,15 +34,15 @@ console.log(`£${pounds}.${pence}`);
3534
*/
3635

3736
function toPounds(penceString) {
38-
let noP = penceString.substring(0,penceString.length -1)
39-
let paddedP = noP.padStart(3,"0")
40-
let pounds= paddedP.substring(0, paddedP.length -2)
41-
42-
let pence= paddedP.substring(paddedP.length -2).padEnd(2,"0")
37+
let noP = penceString.substring(0, penceString.length - 1);
38+
let paddedP = noP.padStart(3, "0");
39+
let pounds = paddedP.substring(0, paddedP.length - 2);
40+
41+
let pence = paddedP.substring(paddedP.length - 2).padEnd(2, "0");
4342

44-
return `£${pounds}.${pence}`
43+
return `£${pounds}.${pence}`;
4544
}
46-
console.log(toPounds("399p"))
47-
console.log(toPounds("5p"))
48-
console.log(toPounds("52p"))
49-
console.log(toPounds("1244p"))
45+
console.log(toPounds("399p"));
46+
console.log(toPounds("5p"));
47+
console.log(toPounds("52p"));
48+
console.log(toPounds("1244p"));

0 commit comments

Comments
 (0)