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

Add delete operator example #6

Merged
merged 3 commits into from
Sep 30, 2017
Merged

Add delete operator example #6

merged 3 commits into from
Sep 30, 2017

Conversation

moonkxn
Copy link
Member

@moonkxn moonkxn commented Sep 29, 2017

Added examples of using delete operator with strict mode.
Missing only cases with prototype chain (MDN).

@tshemsedinov tshemsedinov changed the title Added delete operator example Add delete operator example Sep 29, 2017
Copy link
Member

@tshemsedinov tshemsedinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything ok except one comment


const org = 'HowProgrammingWorks';

// console.log(delete org); // Raises SyntaxError in strict mode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why console.log(delete org); ? Just delete org;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

¯_(ツ)_/¯


const country = {
name: 'Chile',
ruler: 'Augusto Pinochet',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

alive: false
};

delete country.ruler;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✯ 👍 ☭

console.dir({ country });

console.log(delete country.born);
console.log(delete country.population);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💋

Copy link
Member

@tshemsedinov tshemsedinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have same code pattern in other places: console.log(delete...

@moonkxn
Copy link
Member Author

moonkxn commented Sep 30, 2017

I left it to show that this operation returns true, no need in this?

@tshemsedinov
Copy link
Member

By the way, @isceruth, "Minor improvements #2" isn't a good title for commit because #2 refers to issue "Arithmetic operators"

@tshemsedinov tshemsedinov merged commit af006da into master Sep 30, 2017
@tshemsedinov tshemsedinov deleted the delete-operator branch September 30, 2017 23:45
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.

2 participants