Tell us what’s happening: Could you help me what this code not unable to pass 7 and  14 it already works but it did’nt pass yet

function validateManifest(manifest){

let containera = [

“containerId”,

“destination”,

“weight”,

“unit”,

“hazmat”,

]

let result = {};

for(let key of containera){

if(manifest[key] == null) {

result[key] = “Missing”

}

else if (

(key === “containerId” && (!Number.isInteger(manifest[key]) || manifest[key] <= 0 ) ) ||

(key === “destination” && manifest[key]!== “Santa Cruz”) ||

(key === “weight” && (typeof manifest[key] !== “number” || Number.isNaN(manifest[key]) || manifest[key] <= 0)) ||

(key === “unit” && manifest[key] !== “kg” && manifest[key] !== “lb”) ||

(key === “hazmat” && typeof manifest[key] !== “boolean”)

) {

result[key] = “Invalid”;

}

}

return result;

}

//console.log(chr, shallowCopyManifest[chr])

//console.log(normalizeUnits())

console.log(validateManifest({ containerId: 1, destination: “Santa Cruz”, weight: 304, unit: “kg”, hazmat: false

}));

Welcome to the forum @Getahun1 ,

Please include your formatted code and a link to the challenge using the following method:


If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Help button located on the challenge.

The Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.

Happy coding!

Please log this in your function. Considering the way you are using it, it is not what you think.