Skip to content

Commit e35498f

Browse files
committed
Add example
1 parent 81c2619 commit e35498f

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

lib/node_modules/@stdlib/utils/define-properties/lib/polyfill.js

+17
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,23 @@ var defineProperty = require( '@stdlib/utils/define-property' );
3535
* @throws {TypeError} first argument must be an object
3636
* @throws {TypeError} second argument must be an object
3737
* @returns {Object} object with added and/or modified properties
38+
*
39+
* @example
40+
* var obj = {};
41+
* defineProperties( obj, {
42+
* 'foo': {
43+
* 'value': 'bar'
44+
* },
45+
* 'baz': {
46+
* 'value': 13
47+
* }
48+
* });
49+
*
50+
* var val = obj.foo;
51+
* // returns 'bar'
52+
*
53+
* val = obj.baz;
54+
* // returns 13
3855
*/
3956
function defineProperties( obj, props ) {
4057
var keys;

lib/node_modules/@stdlib/utils/define-property/lib/polyfill.js

+8
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ var lookupSetter = objectProtoype.__lookupSetter__;
4747
* @throws {TypeError} third argument must be an object
4848
* @throws {Error} property descriptor has both a value and a setter and/or getter
4949
* @returns {Object} object with added property
50+
*
51+
* @example
52+
* var obj = {};
53+
* defineProperty( obj, 'foo', {
54+
* 'value': 'bar'
55+
* });
56+
* var str = obj.foo;
57+
* // returns 'bar'
5058
*/
5159
function defineProperty( obj, prop, descriptor ) {
5260
var prototype;

0 commit comments

Comments
 (0)