cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

            
              <!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-fixed-top">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <div class="navbar-brand">Online Lodash Tester <small>by <a href="https://form.io" target="_blank"><img src='https://help.form.io/assets/formio-logo.png' style="height:1em" /></a></small>
      </div>
    </div>
    <div id="navbar" class="navbar-collapse collapse">
    </div>
  </div>
</nav>
<div class="container" style="margin-top: 65px;margin-bottom: 150px;">
  <div class="jumbotron">
    <h1>Online Lodash Tester</h1>
    <div class="alert alert-success">Testing Lodash version <strong id="version"></strong></div>
    <p>This is an online tester for the <a href="https://lodash.com" target="_blank">Lodash Library</a>. Simply type your code in the box below and press <strong>Execute</strong>. It will run your code and then show the results in the <strong>Results</strong> section.</p>
    <p>Brought to you with <span class="glyphicon glyphicon-heart" aria-hidden="true"></span> by <a href="https://form.io" target="_blank"><img src='https://help.form.io/assets/formio-logo.png' style="height:1em" /></a>.
    <p>
    </p>
  </div>
  <div class="row">
    <div class="col col-sm-12">
      <h3>Lodash Code</h3>
      <p>Enter your code below. Set the value of <code>result</code> to what you would like to show in the results section.</p>
    </div>
  </div>
  <div class="row">
    <div class="col col-sm-7">
      <div><strong>Example:</strong><pre>
var users = [
  { user: 'barney', age: 36, active: true },
  { user: 'fred',  age: 40, active: false },
  { user: 'travis', age: 37, active: true}
];

result = _.filter(users, function(o) { return o.active; });
      </pre></div>
      <textarea id="code" class="form-control" rows="10" placeholder="Enter your lodash code here."></textarea><br/>
      <a class="btn btn-primary" id="execute">Execute</a>
    </div>
    <div class="col col-sm-5">
      <strong style="margin-top:0;">Result:</strong>
      <pre class="pre-scrollable" style="min-height: 390px;"  id="result"></pre>
    </div>
  </div>
</div> <!-- /container -->
<div class="well" style="text-align:center;margin-bottom:0;border-radius:0;">
  <p>Brought to you by <a href="https://form.io">Form.io</a>
</div>
            
          
!
            
              $('#version').text(_.VERSION);
window._ = _;
$(function() {
  $('#execute').click(function() {
    var code = $('#code').val();
    var result = null;
    try {
      result = eval(code);
    }
    catch (err) {
      result = err.message;
    }
    if (!result) {
      result = 'No result';
    }
    if (typeof result === 'object') {
      try {
        result = JSON.stringify(result, null, '   '); 
      }
      catch (err) {
        result = err.message;
      }
    }
    $('#result').text(result);
  });
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console