This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//1 | |
function convertToF(celsius) { | |
let fahrenheit = celsius * 9/5 + 32;; | |
return fahrenheit; | |
} | |
convertToF(30); | |
//2 | |
function reverseString(str) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function functionWithArgs(a, b) { | |
console.log(a + b); | |
} | |
functionWithArgs(10, 5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setup | |
var myArray = [["John", 23], ["dog", 3]]; | |
myArray.shift(); | |
// Only change code below this line | |
var myArray = [["John", 23], ["dog", 3]]; | |
myArray.shift(); | |
myArray.unshift(["Paul", 35]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setup | |
var myArray = [["John", 23], ["dog", 3]]; | |
// Only change code below this line | |
var removedFromMyArray = myArray.shift(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HIGH_TEMPERATURES = { | |
yesterday: 75, | |
today: 77, | |
tomorrow: 80 | |
}; | |
// Only change code below this line | |
const {today:highToday} = HIGH_TEMPERATURES; | |
const {tomorrow:highTomorrow} = HIGH_TEMPERATURES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HIGH_TEMPERATURES = { | |
yesterday: 75, | |
today: 77, | |
tomorrow: 80 | |
}; | |
// Only change code below this line | |
const {today} = HIGH_TEMPERATURES; /////haciii | |
const {tomorrow} = HIGH_TEMPERATURES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const arr1 = ['JAN', 'FEB', 'MAR', 'APR', 'MAY']; | |
let arr2; | |
arr2 = [...arr1]; // Change this line | |
console.log(arr2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sum = (x, y, z) => { | |
const args = [x, y, z]; | |
return args.reduce((a, b) => a + b, 0); | |
} | |
// | |
const sum = (...args) => { | |
return args.reduce((a, b) => a + b, 0); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const increment = (number, value = 1) => number + value; | |
console.log(increment(5, 2)); | |
console.log(increment(5)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const myConcat =(arr1, arr2) => { | |
"use strict"; | |
return arr1.concat(arr2); | |
}; | |
console.log(myConcat([1, 2], [3, 4, 5])); |
NewerOlder