Content-Length: 279860 | pFad | http://github.com/GameOfCode64/DSA-JavaScript/commit/179c9564c9db4dea4280fcccb97c49563787ae93

37 first commit · GameOfCode64/DSA-JavaScript@179c956 · GitHub
Skip to content

Commit 179c956

Browse files
committed
first commit
0 parents  commit 179c956

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

day.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// ! Day 1 of learning DSA in Javascript
2+
3+
// * create an array with 5 students names, and after that create a function which takes 2 parameters (allStudents, & studentName ) iterate over all students and find that specific studentName
4+
5+
// Todo: The Array data Structure we use
6+
const students = ["Bhavishya", "Ankit", "Anurag", "Aman", "Somil"];
7+
8+
// Todo: This the Algorithm to solve the Problem
9+
function findName(students, studentName) {
10+
for (let i = 0; i < students.length; i++) {
11+
if (studentName.toLowerCase() === students[i].toLowerCase()) {
12+
return `Student Name Matched ${studentName}`;
13+
}
14+
return `Student not Found`;
15+
}
16+
}
17+
18+
console.log(findName(students, "shon"));

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/GameOfCode64/DSA-JavaScript/commit/179c9564c9db4dea4280fcccb97c49563787ae93

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy