Question

// Take the commented ES5 syntax and convert it to ES6 arrow Syntax // let myFunction...

// Take the commented ES5 syntax and convert it to ES6 arrow Syntax

// let myFunction = function () {

// console.log("Function was invoked!");

// };

// myFunction();

// let anotherFunction = function (param) {

// return param;

// };

// anotherFunction("Example");

// let add = function (param1, param2) {

// return param1 + param2;

// };

// add(1,2);

// let subtract = function (param1, param2) {

// return param1 - param2;

// };

// subtract(1,2);

// Stretch

// exampleArray = [1,2,3,4];

// const triple = exampleArray.map(function (num) {

// return num * 3;

// });

// console.log(triple);

Homework Answers

Answer #1

If you have any doubts, please give me comment...

// Take the commented ES5 syntax and convert it to ES6 arrow Syntax

let myFunction = () => {

console.log("Function was invoked!");

};

myFunction();

let anotherFunction = (param) => {

return param;

};

anotherFunction("Example");

let add = (param1, param2) => {

return param1 + param2;

};

add(1, 2);

let subtract = (param1, param2) => {

return param1 - param2;

};

subtract(1, 2); // Stretch

exampleArray = [1, 2, 3, 4];

const triple = exampleArray.map((num) => {

return num * 3;

});

console.log(triple);

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT