Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function partyTime(input) {
- let partyList = {
- "vip": [],
- "regualer": []
- }
- let partyTime = input.splice(0, input.indexOf('PARTY'))
- input.splice(1, input.length - 1).map(x => {
- if (partyTime.includes(x))
- partyTime.splice(partyTime.indexOf(x), 1);
- })
- partyList['vip'] = partyList['vip'].concat(partyTime.filter(x => !isNaN(x[0])))
- partyList['regualer'] = partyList['regualer'].concat(partyTime.filter(x => isNaN(x[0])));
- console.log(partyList['vip'].length + partyList['regualer'].length)
- Object.keys(partyList)
- Object.keys(partyList).map(el => {
- if (partyList[el].length > 0) partyList[el]
- .map(ele => {
- console.log(ele)
- })
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement