I find myself puzzled by the outcome of the TypeScript expression.
selectedLocaleForm: number = 0;
locales: number[] = [0, 1];
index(index: number)` {
let result = index * this.locales.length + this.selectedLocaleForm;
console.log(result);
return result;
}
When I input 0 into the function, it gives back 0 as expected.
I am curious why the index
function returns '01' when this.selectedLocaleForm
gets updated in the HTML select block?