freeCodeCamp/curriculum/challenges/arabic/02-javascript-algorithms-an.../basic-javascript/testing-objects-for-propert...

1.0 KiB

id title challengeType videoUrl localeTitle
567af2437cbaa8c51670a16c Testing Objects for Properties 1

Description

undefined

Instructions

undefined

Tests

tests:
  - text: ''
    testString: 'assert(checkObj("gift") === "pony", "<code>checkObj("gift")</code> should return  <code>"pony"</code>.");'
  - text: ''
    testString: 'assert(checkObj("pet") === "kitten", "<code>checkObj("pet")</code> should return  <code>"kitten"</code>.");'
  - text: ''
    testString: 'assert(checkObj("house") === "Not Found", "<code>checkObj("house")</code> should return  <code>"Not Found"</code>.");'

Challenge Seed

// Setup
var myObj = {
  gift: "pony",
  pet: "kitten",
  bed: "sleigh"
};

function checkObj(checkProp) {
  // Your Code Here

  return "Change Me!";
}

// Test your code by modifying these values
checkObj("gift");

Solution

// solution required