Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

Testing Objects for Properties

function checkObj(obj, checkProp) {
  if(obj.hasOwnProperty(checkProp)){
    return obj[checkProp];
  }else{
    return "Not Found"
  }
}
 
PREVIOUS NEXT
Tagged: #Testing #Objects #Properties
ADD COMMENT
Topic
Name
2+7 =