source files -> src/ folder
This commit is contained in:
1 parent
f006207112
commit
d25f4439fa
144 files changed
No files matched your search
@@ -0,0 +1,21 @@
|
||||
const COURSES = require("./courses.json");
|
||||
|
||||
exports.courses = COURSES;
|
||||
exports.course = getCourseByID;
|
||||
exports.name = getCourseNameByID;
|
||||
|
||||
function getCourseByID(id){
|
||||
for(var i=0; i<COURSES.length; i++){
|
||||
var p = COURSES[i];
|
||||
if(p.id == id){
|
||||
return p;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function getCourseNameByID(id){
|
||||
var p = getCourseByID(id);
|
||||
if(p) return p.name;
|
||||
else return null;
|
||||
}
|
||||
Reference in new issue
Block a user