Vyhledávání na webu

Je operace pop nebo push na n-tici v TypeScriptu neplatná?


např.

let tuple: [string, number];
// the tuple is working
tuple = ["this is string type!", 123456];
tuple.pop();
// ["this is string type!"]
// now , tuple is only 1 item , type like be broken.
console.log(tuple);
tuple.push("this is string type?");
// ["this is string type!","this is string type?"]
// string into number item
console.log(tuple);

Metoda push a pop neuchovává konkrétní pozice v n-tici. Je to chyba? Nebo funkce?