forked from panache-chinmay/javascriptDeccan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript7b.js
More file actions
85 lines (80 loc) · 2.17 KB
/
Copy pathscript7b.js
File metadata and controls
85 lines (80 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
// var message = " ";
// var student ;
//
// // student variable will hold every object as we loop over the array of objects
//
//
// function getStudentReport(student){
// var report = "<h2>Student Name :"+student.name+" </h2>"
// report += "<p>Acheivements :"+student.acheivements+" </p>";
// report += "<p>Track :"+student.track+" </p>";
// report += "<p>Points:"+student.points+" </p>";
// return report;
// }
//
// function print(message){
// document.write(message);
// }
//
// while(true){
//
// var search = prompt("Please Enter the name of student you want to search ['chinmay'] or type quit to exist");
// if(search.toLowerCase() === 'quit' || search === null){
// break;
// }
//
// for(var i = 0 ; i < students.length ; i++){
// student = students[i];
// if(search.toLowerCase() === student.name ){
// message = getStudentReport(student);
// print(message);
// //break;
// }
//
// }
//
// }
// If you click cancel button on the prompt dialouge box ,
// the browser return null value.
//challenge if ther are multiple instance of any name
//
// var message = " ";
// var student ;
// var studentsArray = [];
// //var notFound = false;
//
// // student variable will hold every object as we loop over the array of objects
//
//
// function getStudentReport(student){
// var report = "<h2>Student Name :"+student.name+" </h2>"
// report += "<p>Acheivements :"+student.acheivements+" </p>";
// report += "<p>Track :"+student.track+" </p>";
// report += "<p>Points:"+student.points+" </p>";
// return report;
// }
//
// function print(message){
// document.write(message);
// }
//
// while(true){
// var search = prompt("Please Enter the name of student you want to search ['chinmay'] or type quit to exist");
// if(search.toLowerCase() === 'quit' || search === null){
// break;
// }
//
// for(var i = 0 ; i < students.length ; i++){
// student = students[i];
// if(search.toLowerCase() === student.name ){
// studentsArray.push(student);
// message = getStudentReport(student);
// print(message);
// }
// }
//
// if(studentsArray.length === 0 ){
// alert("Not found.. please search gain")
// }
//
// }