-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
47 lines (38 loc) · 1.13 KB
/
index.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
/*
// 👇 COMPLETE YOUR WORK BELOW 👇
// 👇 COMPLETE YOUR WORK BELOW 👇
// 👇 COMPLETE YOUR WORK BELOW 👇
*/
/**
* ### Challenge `getName`
* @instructions
* Must return input object's `name` property.
*
* Sample data expected output: `Luke Skywalker`
*/
function getName(character) {
// ⭐️ Example Solution Provided For First Function ⭐️
return character.name
}
/**
* ### Challenge `getFilmCount`
* @instructions
* Must return the number of elements in the `films` property.
*
* Sample data expected output: 5
*/
function getFilmCount(character) {
// TODO: Add your code inside the functions (others below).
}
/// ////// END OF CHALLENGE /////////
/// ////// END OF CHALLENGE /////////
/// ////// END OF CHALLENGE /////////
if (typeof exports !== 'undefined') {
// IGNORE: Test/Env Detected
// For Node/Non-browser test env
module.exports = module.exports || {}
if (getName) { module.exports.getName = getName }
if (getFilmCount) { module.exports.getFilmCount = getFilmCount }
// TODO/INSTRUCTOR: ADD ANY FUNCTIONS YOU CREATE TO EXPORTS HERE
// USE THE LINES ABOVE AS A REFERENCE
}