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

Return a default value by get() when the corresponding value is not defined #8

Merged
merged 1 commit into from
Sep 6, 2016
Merged

Conversation

megahertz
Copy link
Contributor

Hi Bastien.

Please let me suggest you to merge this request, which allows to simplify the following code:

let volume = config.get('volume');
volume = volume === undefined ? 1 : volume;

to let volume = config.get('volume', 1);

@de-luca de-luca merged commit 1e96d3e into de-luca:master Sep 6, 2016
@de-luca
Copy link
Owner

de-luca commented Sep 6, 2016

Thanks @megahertz !

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

Successfully merging this pull request may close these issues.

None yet

2 participants