samedi 12 janvier 2019

how to check random words in string become the current word in Object?

how to check random words in string to be the current words which we put in object temp to check in string :

 obj = {
            two: 2,
            three: 3    
        }

if I have those string WTWTHROETEO it means those string words ['TWO', 'TWO' ,'THREE']

here is the input :

let str = WTWTHROETEO

and the output I wanted is: [ 2,2,3 ]

Aucun commentaire:

Enregistrer un commentaire