<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<script src="https://cdn.rawgit.com/lodash/lodash/3.0.1/lodash.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
&lt;script&gt;</p>

<p>function unsplat(fun){
 return function(){
  return fun.call(null, _.toArray(arguments));
 };
}
var joinElements = unsplat(function(array){ return array.join('') });
var view = joinElements(1,2,90,&quot;eee&quot;,&quot;ll&quot;);
console.log(view);</p>

<p>function lameCSV(str){
    return <em>.reduce(str.split(&quot;\n&quot;), function(table, row){
      table.push(</em>.map(row.split(&quot;,&quot;), function(c){return c.trim()}));
      return table;
    }, []);
  };</p>

<p>var peopleTable = lameCSV(&quot;name,age,hair\nMerble,35,red\nBob,64,blonde&quot;);
  console.log(peopleTable)</p>

<p>console.log(_.rest(peopleTable).sort());</p>

<p>var lyrics = [];
  for(var bottles = 5; bottles &gt; 0; bottles--){
    console.log(bottles)
    lyrics.push(bottles + &quot;本のビールが残っている&quot;);
    lyrics.push(bottles + &quot;本のビール&quot;);
    lyrics.push(&quot;ひとつ取って、隣に回せ&quot;);
    if(bottles &gt; 1 ){
      lyrics.push((bottles - 1) + &quot;本のビールが残っている&quot;);
    }else {
      lyrics.push(&quot;もうビールは残っていない&quot;);
    }</p>

<p>}
  console.log(lyrics);
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;

(Visited 1 times, 1 visits today)

コメントを残す

メールアドレスが公開されることはありません。