garageScript / curriculum

GarageScript Curriculum
21 stars 164 forks source link

Add js3/1.js test case for undefined values #348

Closed Oroul closed 3 years ago

Oroul commented 4 years ago

Adds a test case to ensure undefined values in objects are returned by the solution function. This test ensures that valid logic is used to check a key exists in a given object.

if (arr[i] in obj) {...} // will pass if (obj[arr[i]] !== undefined) {...} // will now fail

songz commented 3 years ago

Too specific, I think it may make the content harder for students, so not merging this in for now. Thank you for suggesting it tho!