Skip to content

Commit

Permalink
Merge pull request #19 from zsh77/zsh77/bug-fix
Browse files Browse the repository at this point in the history
changed ?. to . as it was designed to cause a typeError
  • Loading branch information
sudheerj authored Mar 7, 2023
2 parents 50ef836 + 4726388 commit a7c1242
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1910,7 +1910,7 @@ Most of these features already supported by some browsers and try out with babel
}
};

console.log(vehicle.car?.name); // TypeError: Cannot read property 'name' of undefined
console.log(vehicle.car.name); // TypeError: Cannot read property 'name' of undefined

console.log(vehicle.car?.name); // Undefined
console.log(vehicle.car?.speed); // Undefined
Expand Down

0 comments on commit a7c1242

Please sign in to comment.