I'm new to vue.js. I've tried this way to compare two strings, but it seems to fail in vue. How can I solve this issue?
I've tried this:
app.vue
@Component
export default class Game extends Vue{
public word = ""
public words: Array<string> = ["hello", "world"]
public checkValue(): void{
const firstWord = this.words.shift();
if(firstWord === this.word){ // this condition is failing
console.log("Success")
}
}
}
app.html
<md-input v-on:keyup.space="checkValue()" v-model="word"></md-input>
Why this condition is failing?