-
Notifications
You must be signed in to change notification settings - Fork 0
/
codewars-solutions.js
15 lines (9 loc) · 1.12 KB
/
codewars-solutions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Don Drumphet lives in a nice neighborhood, but one of his neighbors has started to let his house go. Don Drumphet wants to build a wall between his house and his neighbor’s, and is trying to get the neighborhood association to pay for it. He begins to solicit his neighbors to petition to get the association to build the wall. Unfortunately for Don Drumphet, he cannot read very well, has a very limited attention span, and can only remember two letters from each of his neighbors’ names. As he collects signatures, he insists that his neighbors keep truncating their names until two letters remain, and he can finally read them.
Your code will show Full name of the neighbor and the truncated version of the name as an array. If the number of the characters in name is less than or equal to two, it will return an array containing only the name as is" */
function whoIsPaying(name){
//your code here
let arr = [];
name.length > 2 ? (arr.push(name), arr.push(name.slice(0, 2))) : arr.push(name);
return arr;
}
let token = "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"