[SOLVED] JavaScript function to check if an object contains given property

15.00 $

Programming resource
Digital learning resource
Category:
✓ Practical programming resource
✓ Suitable for guided study and reference
✓ Tutor guidance available when needed

Description

5/5 - (3 votes)

Write a JavaScript function to check if an object contains given property. Create a function checkGivenProperty() that accepts a object and a property name as arguments and return true or false.

Tip 1: Use hasOwnProperty.call()

Tip 2: First create an object with properties , then use hasOwnProperty.call() to check for a given property.

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.