generated from skills/copilot-codespaces-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
member.js
116 lines (115 loc) · 3.75 KB
/
member.js
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
function skillsMember(){
var skills = [
{
"id": 1,
"name": "HTML",
"description": "HyperText Markup Language is the standard markup language for creating web pages and web applications."
},
{
"id": 2,
"name": "CSS",
"description": "Cascading Style Sheets is a style sheet language used for describing the presentation of a document written in a markup language like HTML."
},
{
"id": 3,
"name": "JavaScript",
"description": "JavaScript is a high-level, interpreted programming language that conforms to the ECMAScript specification."
},
{
"id": 4,
"name": "PHP",
"description": "PHP is a popular general-purpose scripting language that is especially suited to web development."
},
{
"id": 5,
"name": "MySQL",
"description": "MySQL is an open-source relational database management system."
},
{
"id": 6,
"name": "Python",
"description": "Python is an interpreted, high-level, general-purpose programming language."
},
{
"id": 7,
"name": "Java",
"description": "Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented."
},
{
"id": 8,
"name": "C#",
"description": "C# is a general-purpose, multi-paradigm programming language developed by Microsoft."
},
{
"id": 9,
"name": "C++",
"description": "C++ is a general-purpose programming language created by Bjarne Stroustrup as an extension of the C programming language."
},
{
"id": 10,
"name": "C",
"description": "C is a general-purpose, procedural computer programming language supporting structured programming."
},
{
"id": 11,
"name": "Ruby",
"description": "A dynamic, open source programming language with a focus on simplicity and productivity."
},
{
"id": 12,
"name": "Swift",
"description": "Swift is a general-purpose, multi-paradigm, compiled programming language developed by Apple Inc."
}];
//add skills to member
var members = [
{
"id": 1,
"name": "John Doe",
"skills": [1, 2, 3]
},
{
"id": 2,
"name": "Jane Doe",
"skills": [4, 5]
},
{
"id": 3,
"name": "Tom Doe",
"skills": [6]
},
{
"id": 4,
"name": "Jerry Doe",
"skills": [7, 8, 9]
},
{
"id": 5,
"name": "Jill Doe",
"skills": [10]
},
{
"id": 6,
"name": "Jen Doe",
"skills": [11]
},
{
"id": 7,
"name": "Joe Doe",
"skills": [12]
}
];
//display members with skills
var result = members.map(function(member){
var memberSkills = member.skills.map(function(skillId){
return skills.find(function(skill){
return skill.id === skillId;
});
});
return {
"id": member.id,
"name": member.name,
"skills": memberSkills
}
});
console.log(result);
}