lotin yozuvi - raqamni raqamga aylantirish

totalbalancetemp = (Number(this.balance)) + (Number(this.pastAmount));

totalbalancetemp this.balance 34ga teng bo'lsa, this.pastAmount esa 23 ga teng.

Buni tekshirgichda va totalbalancetemp ko'rinishida exp ning html-da ishlataman

1
agar komponentning totalbalancetemp funktsiyasi bo'lsa. uni this.totalbalancetemp orqali qo'ng'iroq qilmasligingiz kerak
qo'shib qo'ydi muallif Thirueswaran Rajagopalan, manba
agar komponentning totalbalancetemp funktsiyasi bo'lsa. uni this.totalbalancetemp orqali qo'ng'iroq qilmasligingiz kerak
qo'shib qo'ydi muallif Thirueswaran Rajagopalan, manba
Kodni formatlash, matn terish va grammatika
qo'shib qo'ydi muallif Simon West, manba
Kodni formatlash, matn terish va grammatika
qo'shib qo'ydi muallif Simon West, manba

8 javoblar

To'g'ri turdagi jihozni yetkazing.

let totalbalancetemp:number = balance + pastAmount

Bu xatolikni keltirib chiqaradi, chunki endi totalbalancetemp number bo'ladi.

Tarmoq satrlari raqamni yozish uchun tayinlanmaydi

Quyidagilarni tekshirib ko'ring:

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true"> <div class="snippet-code">

let balance:string = '34',
    pastAmount:string = '23',
    totalbalancetemp:number = 0

totalbalancetemp = Number(balance) + Number(pastAmount)

alert(totalbalancetemp)
</div> </div>
2
qo'shib qo'ydi
Hali ham menga totalbalancetemp sifatida 0 berib, bu qadriyatlarni qo'shmasdan aslida muvozanat json kabi bu.payment.total va bu.payment.pastAmount
qo'shib qo'ydi muallif john, manba

To'g'ri turdagi jihozni yetkazing.

let totalbalancetemp:number = balance + pastAmount

Bu xatolikni keltirib chiqaradi, chunki endi totalbalancetemp number bo'ladi.

Tarmoq satrlari raqamni yozish uchun tayinlanmaydi

Quyidagilarni tekshirib ko'ring:

<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true"> <div class="snippet-code">

let balance:string = '34',
    pastAmount:string = '23',
    totalbalancetemp:number = 0

totalbalancetemp = Number(balance) + Number(pastAmount)

alert(totalbalancetemp)
</div> </div>
2
qo'shib qo'ydi
Hali ham menga totalbalancetemp sifatida 0 berib, bu qadriyatlarni qo'shmasdan aslida muvozanat json kabi bu.payment.total va bu.payment.pastAmount
qo'shib qo'ydi muallif john, manba
var totalbalancetemp = null; this.balance = 34; this.pastAmount = 23; 

totalbalancetemp = (Number(this.balance)) + (Number(this.pastAmount));

alert(totalbalancetemp);

-->totalbalancetemp - Define Variable (or) any type

0
qo'shib qo'ydi
var totalbalancetemp = null; this.balance = 34; this.pastAmount = 23; 

totalbalancetemp = (Number(this.balance)) + (Number(this.pastAmount));

alert(totalbalancetemp);

-->totalbalancetemp - Define Variable (or) any type

0
qo'shib qo'ydi

.Ts faylida + this.balance yoki this.balance * 1 yoki this.balance/1 faylini shablon faylida bajaring.

0
qo'shib qo'ydi

.Ts faylida + this.balance yoki this.balance * 1 yoki this.balance/1 faylini shablon faylida bajaring.

0
qo'shib qo'ydi

agar bu 2 burchakli burchakning bir qismi bo'lsa, totalbalancetemp bu.totalbalancetemp bilan almashtirilishi kerak.

0
qo'shib qo'ydi

agar bu 2 burchakli burchakning bir qismi bo'lsa, totalbalancetemp bu.totalbalancetemp bilan almashtirilishi kerak.

0
qo'shib qo'ydi
Javascript UZB
Javascript UZB
99 ishtirokchilar

@js_uzb @vuejs_uz @react_uz @nodejs_uz @angular_uz @ngTashkent @yiiframework_uz @laravel_uz @linux_uzbek @python_uz @swift_uzb —————— @uzdevgroup @UzGeeksGroup ——— @UzDev_Jobs @jobs_uzb