3333 *
3434 * Do not edit this code.
3535 */
36- var account = {
36+ const account = {
3737 number : 100402153 ,
3838 initialBalance : 100 ,
39- paymentsUrl : ' /data/payments.json' ,
40- payments : [ ]
39+ paymentsUrl : " /data/payments.json" ,
40+ payments : [ ] ,
4141} ;
4242
4343/**
@@ -48,15 +48,14 @@ var account = {
4848 *
4949 * You may edit this code.
5050 */
51- document . querySelector ( '#loadButton' )
52- . addEventListener ( 'click' , function ( ) {
53- fetch ( account . paymentsUrl )
54- . then ( response => response . json ( ) )
55- . then ( payments => {
56- account . payments = payments ;
57- render ( account ) ;
58- } ) ;
59- } ) ;
51+ document . querySelector ( "#loadButton" ) . addEventListener ( "click" , function ( ) {
52+ fetch ( account . paymentsUrl )
53+ . then ( ( response ) => response . json ( ) )
54+ . then ( ( payments ) => {
55+ account . payments = payments ;
56+ render ( account ) ;
57+ } ) ;
58+ } ) ;
6059
6160/**
6261 * Write a render function below that updates the DOM with the
@@ -72,11 +71,9 @@ document.querySelector('#loadButton')
7271 * @param {Object } account The account details
7372 */
7473function render ( account ) {
75-
7674 // Display the account number
77- document . querySelector ( '#accountNumber' )
78- . innerText = account . number ;
79- } ;
75+ document . querySelector ( "#accountNumber" ) . innerText = account . number ;
76+ }
8077
8178/**
8279 * Write any additional functions that you need to complete
0 commit comments