How do you turn a Javascript user input into a variable? [duplicate]

i dont wanna place any html or css or anything, i tried looking it up and that was all i found

im planning to do this by saying something like

let level = 0
if(userinput) = level up
 level + 1 = level

can someone help me pls

I wanna make a leveling up system where if i say level up, the system will change my level by +1