Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

[SOLVED] How to push the cleaned word(trimmed) to the array?

#1

#2

If javascript follows the same method approach, switch the variable and Array locations to Push the variable trimmed into the passwordArray.

passwordArray.push(trimmed)
1 Like
#3

Thank you so much. This .push method is so rare, i couldn’t even find an example code with him.

#4

In Python the method is not .push but .append, which might be why you don’t see it in any examples. It psyched me out when I read your post at first until I realized you were writing in javascript.

        # Append the cleaned word to passwordArray:
        passwordArray.append(cleanedWord)
1 Like