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({}));




Hi @Getahun1 ,

Please log the manifest[key] here. This code is not doing what you think it’s doing.

Happy coding!