- * @example
- *
- * var collection, query, results;
- *
- * // Create your address book
- * collection = new mw.Map();
- *
- * // This data could be coming from an external source (eg. API/AJAX)
- * collection.set( {
- * 'John Doe': 'john@example.org',
- * 'Jane Doe': 'jane@example.org',
- * 'George van Halen': 'gvanhalen@example.org'
- * } );
- *
- * wanted = ['John Doe', 'Jane Doe', 'Daniel Jackson'];
- *
- * // You can detect missing keys first
- * if ( !collection.exists( wanted ) ) {
- * // One or more are missing (in this case: "Daniel Jackson")
- * mw.log( 'One or more names were not found in your address book' );
- * }
- *
- * // Or just let it give you what it can. Optionally fill in from a default.
- * results = collection.get( wanted, 'nobody@example.com' );
- * mw.log( results['Jane Doe'] ); // "jane@example.org"
- * mw.log( results['Daniel Jackson'] ); // "nobody@example.com"
- *