Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions 1. Introduction/1. The Problem.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const studentsDatabase = ["jordan", "erick", "john", "michel"];

// Algorithm for finding a specific user
const findStudent = (allStudents, studentName) => {
console.log("Searching for " + studentName);
for (let i = 0; i < allStudents.length; i++) {
if (allStudents[i] === studentName) {
console.log(`Found ${studentName}`);
Expand All @@ -11,3 +12,5 @@ const findStudent = (allStudents, studentName) => {
};

findStudent(studentsDatabase, "erick");
findStudent(studentsDatabase, "john");
findStudent(studentsDatabase, "michel");
Binary file added output.txt
Binary file not shown.