Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="container">
  <h1>Array.isArray()</h1>
  <h2>Overview</h2>
  <p>This returns a true of false value depending on whether the argument passed in is an array or not.</p>
  <h2>Syntax</h2>
  <code>Array.isArray(obj)</code>
  <h2>Parameters</h2>
  <p>Pass is one argument in any format and the method will tell you if it is an array.</p>
  <h2>Examples</h2>
  <p>Thanks to MDN for the following examples</p>
  
  <p><code>Array.isArray([]);</code> returns <code id="output1"></code></p>
  <p><code>Array.isArray([1]);</code> returns <code id="output2"></code></p>
  <p><code>Array.isArray(new Array());</code> returns <code id="output3"></code></p>
    <p>Little known fact: Array.prototype itself is an array:</p>
  <p><code>Array.isArray(Array.prototype);</code> returns <code id="output4"></code></p>

  <p>All following calls return false</p>
  <p><code>Array.isArray();</code> returns <code id="output5"></code></p>
  <p><code>Array.isArray({});</code> returns <code id="output6"></code></p>
  <p><code>Array.isArray(null);</code> returns <code id="output7"></code></p>
  <p><code>Array.isArray(undefined);</code> returns <code id="output8"></code></p>
  <p><code>Array.isArray(17);</code> returns <code id="output9"></code></p>
  <p><code>Array.isArray('Array');</code> returns <code id="output10"></code></p>
  <p><code>Array.isArray(true);</code> returns <code id="output11"></code></p>
  <p><code>Array.isArray(false);</code> returns <code id="output12"></code></p>
  <p><code>Array.isArray({ __proto__: Array.prototype });</code> returns <code id="output13"></code></p>

  <h2>Try for yourself</h2>
  <p><code>Array.isArray(</code><input id="tryOutput" type="text"><code>);</code> returns <code></code></p>
  
</div>
              
            
!

CSS

              
                body { 
  font-family: sans-serif;
  background-color: rgb(29, 31, 32);
  color: #fff;
  font-size: 1.6em;
  margin-left: 24px;
}
p {
  margin-bottom: 12px;
  color: #fff;
}
              
            
!

JS

              
                $('#output1').html(Array.isArray([]).toString());
$('#output2').html(Array.isArray([1]).toString());
$('#output3').html(Array.isArray(new Array()).toString());
// Little known fact: Array.prototype itself is an array:
$('#output4').html(Array.isArray(Array.prototype).toString()); 

// all following calls return false
$('#output5').html(Array.isArray().toString());
$('#output6').html(Array.isArray({}).toString());
$('#output7').html(Array.isArray(null).toString());
$('#output8').html(Array.isArray(undefined).toString());
$('#output9').html(Array.isArray(17).toString());
$('#output10').html(Array.isArray('Array').toString());
$('#output11').html(Array.isArray(true).toString());
$('#output12').html(Array.isArray(false).toString());
$('#output13').html(Array.isArray({ __proto__: Array.prototype }).toString());
              
            
!
999px

Console