Home Get variables outside of method (object)
Reply: 0

Get variables outside of method (object)

user1085
1#
user1085 Published in June 23, 2018, 7:59 am

I am looking to retrieve variables outside a method, but OOP is something new for me, i'm a little stuck ...

const Reservation = {
    play: document.getElementById('Reservation'),
    reset: document.getElementById('annuler'),

    launch_functions_sessionStorage: function () {
        this.onReservation();
        this.displayIfChecked();
        this.set_Timer();
    },

    displayIfChecked: function () {
        SOMETHING
    },

    onReservation: function () {
        $('#Reservation, .signature',).click(function () {
            console.log();
            if (SOMETHING) {
                let checked = 1;
            } else {
                let checked = 0;
            }
        });
    },

    set_Timer: function () {

        Reservation.play.addEventListener('click', function(){
            if('I would like to get 'checked'){}
        });
    }
};
Reservation.launch_functions_sessionStorage();

I tried to keep important information for your understanding. Meanwhile sorry for my english... Thank you very much

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.545496 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO