0

what i am doing wrong?

``` displayCartTotal, use the formatAsMoney function to set appState.billFormated to the formatted total bill. The already assigned appState.bill and appState.country should come be handy now! Set the text content of the data-bill SPAN to the formatted bill set in appState.billFormated Finally, call uiCanInteract to wrap up displayCartTotal. javascript code const displayCartTotal = ({results}) => { const [data] = results; const {itemsInCart, buyerCountry} = data; appState.items = itemsInCart; appState.country = buyerCountry; appState.bill = itemsInCart.reduce((total, {qty, Price}) => { return total + (price * qty)}); appState.billFormated = formatAsMoney(appState.bill, appState.country); document.querySelector('[data-bill]').textContent = appstate.billFormated; uiCanInteract(); }; ```

14th Jul 2019, 10:37 AM
sheriff salam
sheriff salam - avatar
3 odpowiedzi
0
help us o!!! 😢
8th Aug 2019, 6:10 PM
Davies Nurudeen
Davies Nurudeen - avatar
0
Try this const displayCartTotal= ({results}) => { const [data]=results; const {itemsInCart, buyerCountry}=data; appState.items=itemsInCart; appState.country=buyerCountry; appState.bill=itemsInCart.reduce((total,item)=> { return total+(items.price*item.qty)}); appState.billFormatted=formatAsMoney(appState.bill,appState.country); document.querySelector("[data-bill]").textContent=appState.billFormatted; appState.cardDigits=[]; uiCanInteract(); };
10th Aug 2019, 10:49 AM
Oyebo Abdulhamiid Haremu
Oyebo Abdulhamiid Haremu - avatar
0
here is my code where is the syntax error coming from <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta http-equiv="X-UA-Compatible" content="ie=edge" /> <title>Mini App</title> <style> body { margin: 0; padding: 1em; background-color:white; } [data-cart-info], [data-credit-card] { transform: scale(0.78); margin-left: -3.4em; } [data-cc-info] input:focus, [data-cc-digits] input:focus { outline: none; } .mdc-card__primary-action, .mdc-card__primary-action:hover { cursor: auto; padding: 20px; min-height: inherit; } [data-credit-card] [data-card-type] { transition: width 1.5s; margin-left: calc(100% - 130px); } [data-credit-card].is-visa { background: linear-gradient(135deg, #622774 0%, #c53364 100%); } [data-credit-card].is-mastercard { background: linear-gradient(135deg, #65799b 0%, #5e2563 100%); } .is-visa [data-card-type], .is-mastercard [data-card-type] { width: auto; } input.is-invalid, .is-invalid input { text-decoration: line-through; } ::placeholder { color: #fff; } span { display: inline-block; vertical-align: middle; } span.material-icons{ font-size:150px; } [data-credit-card]{ width:435px; min-height:240px; border-radius:10px; background-color:#5d6874; } [data-card-type]{ display:block; width:120px; height:60px } [data-cc-digits]{ margin-top:2em; } [data-cc-digits]> input{ color:#ffffff; font-size:2em; line-height:2em; margin-right:0.5em; background:none; border:none; } [data-cc-info]{ margin-top:1em; } [data-cc-info]>input{ color:#ffffff; font-size:1.2em; background:none; border:none; } [data-cc-info]>input
10th Aug 2019, 1:55 PM
EVANS OCHUKA
EVANS OCHUKA - avatar