From 99e8d6159834eebf36369488ececdb9b53a49ba0 Mon Sep 17 00:00:00 2001 From: koronya Date: Wed, 17 Jun 2026 03:19:33 +0900 Subject: [PATCH] [JS][7kyu] Add property to every object in array --- .../koronya.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 codewars/7kyu/add-property-to-every-object-in-array/koronya.js diff --git a/codewars/7kyu/add-property-to-every-object-in-array/koronya.js b/codewars/7kyu/add-property-to-every-object-in-array/koronya.js new file mode 100644 index 000000000..761b666fc --- /dev/null +++ b/codewars/7kyu/add-property-to-every-object-in-array/koronya.js @@ -0,0 +1,18 @@ +// [JS][7kyu] Add property to every object in array +// add-property-to-every-object-in-array +// https://www.codewars.com/kata/54e8c3e89e2ae6f4900005a1/train/javascript + +var questions = [ + { + question: "What's the currency of the USA?", + choices: ['US dollar', 'Ruble', 'Horses', 'Gold'], + corAnswer: 0, + }, + { + question: 'Where was the American Declaration of Independence signed?', + choices: ['Philadelphia', 'At the bottom', "Frankie's Pub", 'China'], + corAnswer: 0, + }, +] + +questions = questions.map((item) => ({ ...item, usersAnswer: null }))