Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>Lodash Demo</title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
  <script src="https://cdn.jsdelivr.net/lodash/4/lodash.min.js"></script>
  <script>
    $(function() {
      $("#lodashdemo1").on('click',function(){
        var years = _.range(1911, 2014);
        alert(years);
      });
      $("#lodashdemo2").on('click',function(){
        var evens = _.filter([1, 2, 3, 4, 5, 6], function(num) { return num % 2 == 0; });
        alert(evens);        
      });
    });
  </script>
</head>
<body>
  <button id="lodashdemo1">取得年分</button>
  <button id="lodashdemo2">取得偶數</button>
</body>
</html>
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
peterjupro
0viewers