Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax of arguments #2

Open
tamtakoe opened this issue May 5, 2016 · 0 comments
Open

Syntax of arguments #2

tamtakoe opened this issue May 5, 2016 · 0 comments

Comments

@tamtakoe
Copy link
Contributor

tamtakoe commented May 5, 2016

Instead of 4 arguments in function:

 facebook: function(facebook, contacts, user, path)

You can use every argument for every nested level

 facebook: function(facebook, contacts, user)

F. e.

var obj = {
    a: {
        b: {
            c: {
                d: '123'
            }
        }
    }
}

var schema = {
    a: {
        b: {
            c: {
                e: (e, c, b, a, obj) => {
                    //If you want to get original object it will be guaranteed last argument
                    obj = Array.from(arguments).pop();
                    //But it's easier to use this
                    obj = this
                }
            }
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant