Delete multiple object properties?

ES6 provides an elegant solution to this: Rest in Object Destructuring: let { a, b, …rest } = { a: 10, b: 20, c: 30, d: 40 }; console.log(rest); // { c: 30, d: 40 } Note that this doesn’t mutate the original object, but some folks might still find this useful. Ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment

Inheriting methods’ docstrings in Python

This is a variation on Paul McGuire’s DocStringInheritor metaclass. It inherits a parent member’s docstring if the child member’s docstring is empty. It inherits a parent class docstring if the child class docstring is empty. It can inherit the docstring from any class in any of the base classes’s MROs, just like regular attribute inheritance. …

Read more

JavaScript: The Good Parts – How to not use `new` at all

Crockford gives an example for an object creation function as should have been provided by JS itself in one of his Javascript talks available on http://developer.yahoo.com/yui/theater/ However, the YUI(3) team itself uses “new”, and they DO follow his recommendations (since he’s the Yahoo chief JS architect (UPDATE: he moved on, but the statement was true …

Read more