Skip to content
This repository was archived by the owner on Oct 26, 2020. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Exercise-array-some
  • Loading branch information
NihalAli2 committed Jun 26, 2020
commit 59907cab1e4e1b3539b7cf4ad15a6060a60a5711
5 changes: 5 additions & 0 deletions week-3/1-exercises/B-array-some/exercise.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ var pairsByIndex = [[0, 3], [1, 2], [2, 1], null, [3, 0]];
// https://nodejs.org/api/process.html#process_process_exit_code
// process.exit(1);


var students = ["Islam", "Lesley", "Harun", "Rukmini"];
var mentors = ["Daniel", "Irina", "Mozafar", "Luke"];

var pairs = pairsByIndex.map(function(indexes) {
if (indexes === null) {
process.exit(1);
}
var student = students[indexes[0]];
var mentor = mentors[indexes[1]];

return [student, mentor];
});

Expand Down