Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

TypeScript Object Help

$
0
0

@saimonventura wrote:

I have the code:

let linha = { quantidade: 1 };
let coluna = [];

coluna.push(linha);
coluna.push(linha);

coluna[0].quantidade++;

console.log(coluna);

alert(coluna[0].quantidade + ' ' + coluna[1].quantidade);

result:
coluna[0].quantidade = 1;
coluna[1].quantidade = 1;

expected
coluna[0].quantidade = 1;
coluna[1].quantidade = 0;

how can I make this?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>