Skip to content

Instantly share code, notes, and snippets.

View mahmoud-samy's full-sized avatar

Mahmoud Samy mahmoud-samy

View GitHub Profile
// given the following data object, write functions that returns:
// 1- All professors
// 2- All students
// 3- Name of students with gpa higher than 3.1
// 4- A function that takes the prof. id and return all of his courses by name
var data = {
"users": [{
"id": "001",
"name": "Prof. Alaa Ahmed",
// Write a sum method which will work properly when invoked using either syntax below.
console.log(sum(2,3)); // Outputs 5
console.log(sum(2)(3)); // Outputs 5