Advertisement
bebo231312312321

Untitled

Mar 7th, 2023
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function partyTime(input) {
  2.     let partyList = {
  3.         "vip": [],
  4.         "regualer": []
  5.     }
  6.     let partyTime = input.splice(0, input.indexOf('PARTY'))
  7.     input.splice(1, input.length - 1).map(x => {
  8.         if (partyTime.includes(x))
  9.             partyTime.splice(partyTime.indexOf(x), 1);
  10.     })
  11.     partyList['vip'] = partyList['vip'].concat(partyTime.filter(x => !isNaN(x[0])))
  12.     partyList['regualer'] = partyList['regualer'].concat(partyTime.filter(x => isNaN(x[0])));
  13.     console.log(partyList['vip'].length + partyList['regualer'].length)
  14.     Object.keys(partyList)
  15.     Object.keys(partyList).map(el => {
  16.         if (partyList[el].length > 0) partyList[el]
  17.             .map(ele => {
  18.                 console.log(ele)
  19.             })
  20.     })
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement