From ad36e81cef3538dd049870b64861883f24c5aff4 Mon Sep 17 00:00:00 2001 From: Lucas Camino <31540151+lucasca95@users.noreply.github.com> Date: Thu, 5 Aug 2021 04:41:14 -0300 Subject: [PATCH] Add Q82 (#2025) Q82. What is wrong with this code? --- javascript/javascript-quiz.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/javascript/javascript-quiz.md b/javascript/javascript-quiz.md index 4dd82f5a26..6113c6389f 100755 --- a/javascript/javascript-quiz.md +++ b/javascript/javascript-quiz.md @@ -880,3 +880,20 @@ class TaxCalculator { - [ ] new TaxCalculator().calculate(\$50); - [x] TaxCalculator.calculate(50); - [ ] new TaxCalculator().calculate(50); + +#### Q82. What is wrong with this code? + +```js +const foo = { + bar(){ + console.log("Hello, world!"); + }, + name: "Albert", + age: 26, +} +``` + +- [ ] The function bar needs to be defined as a key/value pair. +- [ ] Trailing commas are not allowed in JavaScript. +- [ ] Functions cannot be declared as properties of objects. +- [x] Nothing, there are no errors.