js/calc-controller.js
/* Bind listener and handler to 'C' button */
Bind listener and handler to 'C' button
Bind listener and handler to ' C ' button
function clearController() {
    view.clear.addEventListener('click', () => {
        const state = view.clear.dataset['state'];
        if (view.clear.dataset['state'] === 'C') {
            model.c();
            show();
            view.clear.dataset['state'] = 'AC';
            view.clear.innerHTML = 'AC';
        } else { 
            model.ac();
            show();
        }
    }, false);
}
function clearController ( ) { view . clear . addEventListener ( 'click' , ( ) => { const state = view . clear . dataset [ 'state' ] ; if ( view . clear . dataset [ 'state' ] === 'C' ) { model . c ( ) ; show ( ) ; view . clear . dataset [ 'state' ] = 'AC' ; view . clear . innerHTML = 'AC' ; } else { model . ac ( ) ; show ( ) ; } } , false ) ; }
Bind listener and handler to 'C' button
Bind listener and handler to ' C ' button
// state === AC