1.Create Strings using Template Literals
const result = {
success: ["max-length", "no-amd", "prefer-arrow-functions"],
failure: ["no-var", "var-on-top", "linebreak"],
skipped: ["no-extra-semi", "no-dup-keys"]
};
function makeList(arr) {
// Only change code below this line
const failureItems = arr.map(item=>`<li class="text-warning">${item}</li>`);
// Only change code above this line
return failureItems;
}
const failuresList = makeList(result.failure);
const result = {
success: ["max-length", "no-amd", "prefer-arrow-functions"],
failure: ["no-var", "var-on-top", "linebreak"],
skipped: ["no-extra-semi", "no-dup-keys"]
};
function makeList(arr) {
// Only change code below this line
const failureItems = [];
for(let i =0;i<arr.length;i++){
failureItems.push(`<li class="text-warning">${arr[i]}</li>`)
}
// Only change code above this line
return failureItems;
}
const failuresList = makeList(result.failure);
2.Write Concise Object Literal Declarations Using Object Property Shorthand
const createPerson = (name, age, gender) => {
// Only change code below this line
return ({name,age,gender});
// Only change code above this line
};
var person=createPerson("Zodiac Hasbro", 56, "male")