Script
Scriptβ€’3y ago

Script – 23-22 Jan 26

What does the OR statement do in this block of code?
result = cars.reduce(function (r, a) {
console.log("RR",r)
r[a.make] = r[a.make] || [];
r[a.make].push(a);
return r;
}, Object.create(null));
result = cars.reduce(function (r, a) {
console.log("RR",r)
r[a.make] = r[a.make] || [];
r[a.make].push(a);
return r;
}, Object.create(null));
3 Replies
Unknown User
Unknown Userβ€’3y ago
Message Not Public
Sign In & Join Server To View
Script
ScriptOPβ€’3y ago
ah make sense. thanks
reactibot
reactibotβ€’3y ago
This question has an answer! Thank you for helping πŸ˜„ If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/936038336760524840 This question has an answer! Thank you for helping πŸ˜„ If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/936038336760524840 This thread hasn’t had any activity in 12 hours, so it’s now locked. Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/936038336760524840