diff --git a/copy/examples/index.js b/copy/examples/index.js index 92ef93cd..4ac9afcd 100644 --- a/copy/examples/index.js +++ b/copy/examples/index.js @@ -22,10 +22,7 @@ var randu = require( '@stdlib/random/base/randu' ); var Int32Array = require( '@stdlib/array/int32' ); var copy = require( './../lib' ); -var arr; -var out; - -arr = [ +var arr = [ { 'x': new Date(), 'y': [ randu(), randu() ], @@ -41,7 +38,7 @@ arr = [ ]; // Perform a full-deep copy: -out = copy( arr ); +var out = copy( arr ); console.log( arr[ 0 ] === out[ 0 ] ); // => false diff --git a/property-symbols-in/README.md b/property-symbols-in/README.md index 48749b4e..099272d3 100644 --- a/property-symbols-in/README.md +++ b/property-symbols-in/README.md @@ -63,11 +63,7 @@ var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); var Symbol = require( '@stdlib/symbol/ctor' ); var propertySymbolsIn = require( '@stdlib/utils/property-symbols-in' ); -var hasSymbols; -var symbols; -var obj; - -hasSymbols = hasSymbolSupport(); +var hasSymbols = hasSymbolSupport(); function Foo() { if ( hasSymbols ) { @@ -80,8 +76,8 @@ if ( hasSymbols ) { Foo.prototype[ Symbol( 'foo' ) ] = 'bar'; } -obj = new Foo(); -symbols = propertySymbolsIn( obj ); +var obj = new Foo(); +var symbols = propertySymbolsIn( obj ); console.log( symbols ); ``` diff --git a/property-symbols-in/examples/index.js b/property-symbols-in/examples/index.js index 5d38870e..11b553fb 100644 --- a/property-symbols-in/examples/index.js +++ b/property-symbols-in/examples/index.js @@ -22,11 +22,7 @@ var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); var Symbol = require( '@stdlib/symbol/ctor' ); var propertySymbolsIn = require( './../lib' ); -var hasSymbols; -var symbols; -var obj; - -hasSymbols = hasSymbolSupport(); +var hasSymbols = hasSymbolSupport(); function Foo() { if ( hasSymbols ) { @@ -39,7 +35,7 @@ if ( hasSymbols ) { Foo.prototype[ Symbol( 'foo' ) ] = 'bar'; } -obj = new Foo(); -symbols = propertySymbolsIn( obj ); +var obj = new Foo(); +var symbols = propertySymbolsIn( obj ); console.log( symbols ); diff --git a/try-function/README.md b/try-function/README.md index ebf0bf52..ede41b4d 100644 --- a/try-function/README.md +++ b/try-function/README.md @@ -152,13 +152,10 @@ function done( str ) { } } -var out; -var f; - // Synchronous... -f = wrap( beep ); +var f = wrap( beep ); -out = f( 'boop' ); +var out = f( 'boop' ); console.log( out ); // => 'beep boop' diff --git a/try-function/examples/index.js b/try-function/examples/index.js index 1a6be7aa..cf668b89 100644 --- a/try-function/examples/index.js +++ b/try-function/examples/index.js @@ -49,13 +49,10 @@ function done( str ) { } } -var out; -var f; - // Synchronous... -f = wrap( beep ); +var f = wrap( beep ); -out = f( 'boop' ); +var out = f( 'boop' ); console.log( out ); // => 'beep boop' diff --git a/try-require/README.md b/try-require/README.md index d541cb15..bf07b676 100644 --- a/try-require/README.md +++ b/try-require/README.md @@ -89,9 +89,7 @@ if ( x instanceof Error ) { ```javascript var tryRequire = require( '@stdlib/utils/try-require' ); -var out; - -out = tryRequire( '_abcdefghijklmnopqrstuvwxyz123456789_' ); +var out = tryRequire( '_abcdefghijklmnopqrstuvwxyz123456789_' ); if ( out instanceof Error ) { console.error( out.message ); } else { diff --git a/try-require/examples/index.js b/try-require/examples/index.js index ce0c83a2..161a232c 100644 --- a/try-require/examples/index.js +++ b/try-require/examples/index.js @@ -20,9 +20,7 @@ var tryRequire = require( './../lib' ); -var out; - -out = tryRequire( '_abcdefghijklmnopqrstuvwxyz123456789_' ); +var out = tryRequire( '_abcdefghijklmnopqrstuvwxyz123456789_' ); if ( out instanceof Error ) { console.error( out.message ); } else { diff --git a/writable-properties-in/README.md b/writable-properties-in/README.md index 09f096dc..e9b3f385 100644 --- a/writable-properties-in/README.md +++ b/writable-properties-in/README.md @@ -72,11 +72,7 @@ var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); var Symbol = require( '@stdlib/symbol/ctor' ); var writablePropertiesIn = require( '@stdlib/utils/writable-properties-in' ); -var hasSymbols; -var props; -var obj; - -hasSymbols = hasSymbolSupport(); +var hasSymbols = hasSymbolSupport(); function Foo() { this.a = 'a'; @@ -115,11 +111,9 @@ if ( hasSymbols ) { }); } -obj = new Foo(); -props = writablePropertiesIn( obj ); - -console.log( props ); -// e.g., => [ 'a', 'foo', ... ] +var obj = new Foo(); +var props = writablePropertiesIn( obj ); +// e.g., returns [ 'a', 'foo', ... ] ``` diff --git a/writable-properties-in/examples/index.js b/writable-properties-in/examples/index.js index cd56e78b..485a35ba 100644 --- a/writable-properties-in/examples/index.js +++ b/writable-properties-in/examples/index.js @@ -23,11 +23,7 @@ var hasSymbolSupport = require( '@stdlib/assert/has-symbol-support' ); var Symbol = require( '@stdlib/symbol/ctor' ); var writablePropertiesIn = require( './../lib' ); -var hasSymbols; -var props; -var obj; - -hasSymbols = hasSymbolSupport(); +var hasSymbols = hasSymbolSupport(); function Foo() { this.a = 'a'; @@ -66,8 +62,7 @@ if ( hasSymbols ) { }); } -obj = new Foo(); -props = writablePropertiesIn( obj ); - +var obj = new Foo(); +var props = writablePropertiesIn( obj ); console.log( props ); // e.g., => [ 'a', 'foo', ... ] diff --git a/writable-properties/README.md b/writable-properties/README.md index e0e12c70..d52bce25 100644 --- a/writable-properties/README.md +++ b/writable-properties/README.md @@ -71,8 +71,6 @@ var Symbol = require( '@stdlib/symbol/ctor' ); var writableProperties = require( '@stdlib/utils/writable-properties' ); var hasSymbols = hasSymbolSupport(); -var props; -var obj; function Foo() { this.a = 'a'; @@ -99,11 +97,9 @@ if ( hasSymbols ) { Foo.prototype[ Symbol( 'c' ) ] = 'c'; } -obj = new Foo(); -props = writableProperties( obj ); - -console.log( props ); -// e.g., => [ 'a', ... ] +var obj = new Foo(); +var props = writableProperties( obj ); +// e.g., returns [ 'a', ... ] ``` diff --git a/writable-properties/examples/index.js b/writable-properties/examples/index.js index 925c3f2d..2f89024f 100644 --- a/writable-properties/examples/index.js +++ b/writable-properties/examples/index.js @@ -24,8 +24,6 @@ var Symbol = require( '@stdlib/symbol/ctor' ); var writableProperties = require( './../lib' ); var hasSymbols = hasSymbolSupport(); -var props; -var obj; function Foo() { this.a = 'a'; @@ -52,8 +50,7 @@ if ( hasSymbols ) { Foo.prototype[ Symbol( 'c' ) ] = 'c'; } -obj = new Foo(); -props = writableProperties( obj ); - +var obj = new Foo(); +var props = writableProperties( obj ); console.log( props ); // => [ 'a', ... ] diff --git a/writable-property-symbols/README.md b/writable-property-symbols/README.md index fe94f069..82d82601 100644 --- a/writable-property-symbols/README.md +++ b/writable-property-symbols/README.md @@ -79,8 +79,6 @@ var Symbol = require( '@stdlib/symbol/ctor' ); var writablePropertySymbols = require( '@stdlib/utils/writable-property-symbols' ); var hasSymbols = hasSymbolSupport(); -var symbols; -var obj; function Foo() { if ( hasSymbols ) { @@ -93,10 +91,9 @@ if ( hasSymbols ) { Foo.prototype[ Symbol( 'bip' ) ] = 'bop'; } -obj = new Foo(); -symbols = writablePropertySymbols( obj ); - -console.log( symbols ); +var obj = new Foo(); +var symbols = writablePropertySymbols( obj ); +// e.g., returns [ Symbol( 'baz' ) ] ``` diff --git a/writable-property-symbols/examples/index.js b/writable-property-symbols/examples/index.js index 5b90e6c7..b2b960da 100644 --- a/writable-property-symbols/examples/index.js +++ b/writable-property-symbols/examples/index.js @@ -23,8 +23,6 @@ var Symbol = require( '@stdlib/symbol/ctor' ); var writablePropertySymbols = require( './../lib' ); var hasSymbols = hasSymbolSupport(); -var symbols; -var obj; function Foo() { if ( hasSymbols ) { @@ -37,7 +35,7 @@ if ( hasSymbols ) { Foo.prototype[ Symbol( 'bip' ) ] = 'bop'; } -obj = new Foo(); -symbols = writablePropertySymbols( obj ); - +var obj = new Foo(); +var symbols = writablePropertySymbols( obj ); console.log( symbols ); +// e.g., returns [ Symbol( 'baz' ) ]