<commit_before><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <title>Java-Script - Yvonne Zhang</title>
    <meta name="description" content="" />

    <meta name="HandheldFriendly" content="True" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="shortcut icon" href="https://YvonneZhang.github.io/favicon.ico">

    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Merriweather:400,700,400italic,700italic|Open+Sans:400italic,700italic,700,400">
    <link rel="stylesheet" type="text/css" href="//YvonneZhang.github.io/themes/roon/assets/css/screen.css?v=1468049982238" />

    <link rel="canonical" href="https://YvonneZhang.github.io/https://YvonneZhang.github.io/tag/Java-Script/" />
    <meta name="referrer" content="origin" />
    
    <meta property="og:site_name" content="<NAME>" />
    <meta property="og:type" content="website" />
    <meta property="og:title" content="Java-Script - Yvonne Zhang" />
    <meta property="og:url" content="https://YvonneZhang.github.io/https://YvonneZhang.github.io/tag/Java-Script/" />
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Java-Script - Yvonne Zhang" />
    <meta name="twitter:url" content="https://YvonneZhang.github.io/https://YvonneZhang.github.io/tag/Java-Script/" />
    
    <script type="application/ld+json">
null
    </script>

    <meta name="generator" content="HubPress" />
    <link rel="alternate" type="application/rss+xml" title="<NAME>" href="https://YvonneZhang.github.io/rss/" />
</head>
<body class="tag-template tag-Java-Script user ">

    
<header role="banner">
    <div class="wrap">
        <h1><a href="https://YvonneZhang.github.io">Tag: Java-Script</a></h1>
        <hr>
    </div>
</header>


<article class="post tag-Java-Script ">


    <div class="meta">
        <time datetime="2016-06-21"><a href="https://YvonneZhang.github.io/2016/06/21/Generator.html">June 21, 2016</a></time>
    </div>

    <header>
        <h1><a href="https://YvonneZhang.github.io/2016/06/21/Generator.html">Generator 函数初探</a></h1>
    </header>

    <div class="text">
        <p>前言 Generator 函数是 ES6 一个很重要的特性，但其涉及的概念却不太能一眼就看懂，所以写下这篇小文以作学习记录。 定义一个 generator 函数 定义一个 generator 函数十分简单，和正常的函数定义相比，多加一个 * 就可以了： function * name(arguments) {   statements } 但 generator 函数与普通函数的区别却非常大，它的优势在于，退出函数之后可以再次进入，函数的上下文会被保留。每次退出 generator 函数，它都会返回一个值，这不是一个普通的值，而是一个迭代器（iterator）对象。下面就来说一说迭代器对象。 迭代器对象 迭代器有一个特别</p>
        <a href="https://YvonneZhang.github.io/2016/06/21/Generator.html" class="readmore">Continue Reading</a>
    </div>
</article>

<nav class="pagination" role="navigation">
    <span class="page-number">Page 1 of 1</span>
</nav>


<footer role="contentinfo">
    <div class="inner">
        <div class="vcard">
            <!-- <a href="https://YvonneZhang.github.io/rss" id="btn_feed" class="btn" title="Feed" target="_blank">
                <span aria-hidden="true" data-icon=")"></span>
                <strong>Feed</strong>
            </a> -->


            <div class="details">
                <h4><a href="https://YvonneZhang.github.io" class="url n"><NAME></a></h4>
                <a href="https://YvonneZhang.github.io" class="js-remove-domain-schema">https://YvonneZhang.github.io</a><br>
                <span>Published with <a href="http://hubpress.io">HubPress</a></span>
            </div>
        </div>
        <div id="user_bio">
            <div class="inner">
                暂无一席地
            </div>
        </div>
    </div>
</footer>




    <script>


        function no_schema_links () {
            var links = document.querySelectorAll('.js-remove-domain-schema');
            if (links) {
                for (i = 0; i < links.length; ++i) {
                    var link = links[i],
                        text = link.innerHTML,
                        no_schema = text.replace(/.*?:\/\//g, "");
                    link.innerHTML = no_schema;
                }
            }
        }

        window.onload = function () {
            no_schema_links();

        }
    </script>

    <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js?v="></script> <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.min.js?v="></script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js?v="></script> 
      <script type="text/javascript">
        jQuery( document ).ready(function() {
          // change date with ago
          jQuery('ago.ago').each(function(){
            var element = jQuery(this).parent();
            element.html( moment(element.text()).fromNow());
          });
        });

        hljs.initHighlightingOnLoad();
      </script>




</body>
</html><commit_msg>Publish page-1 tag<commit_after><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <title>Java-Script - <NAME></title>
    <meta name="description" content="" />

    <meta name="HandheldFriendly" content="True" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <link rel="shortcut icon" href="https://YvonneZhang.github.io/favicon.ico">

    <script type="text/javascript" src="//YvonneZhang.github.io/themes/ichi/assets/js/vendor/fastclick.js?v=1468050085646"></script>
    <script type="text/javascript" src="//YvonneZhang.github.io/themes/ichi/assets/js/vendor/modernizr.js?v=1468050085646"></script>


    <link rel="stylesheet" type="text/css" href="//YvonneZhang.github.io/themes/ichi/assets/css/normalize.css?v=1468050085646" />
    <link rel="stylesheet" type="text/css" href="//YvonneZhang.github.io/themes/ichi/assets/css/foundation.min.css?v=1468050085646" />
    <!--[if lte IE 8]>
        <link rel="stylesheet" type="text/css" href="//YvonneZhang.github.io/themes/ichi/assets/css/outdatedBrowser.min.css?v=1468050085646">
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="//YvonneZhang.github.io/themes/ichi/assets/fonts/foundation-icons/foundation-icons.css?v=1468050085646" />
    <link rel="stylesheet" type="text/css" href="//YvonneZhang.github.io/themes/ichi/assets/css/styles.css?v=1468050085646" />
    <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans:300,700,400|Source+Sans+Pro:300,400,600,700,900,300italic,400italic,600italic,700italic,900italic" />

    <link rel="canonical" href="https://YvonneZhang.github.io/https://YvonneZhang.github.io/tag/Java-Script/" />
    <meta name="referrer" content="origin" />
    
    <meta property="og:site_name" content="<NAME>" />
    <meta property="og:type" content="website" />
    <meta property="og:title" content="Java-Script - Yvonne Zhang" />
    <meta property="og:url" content="https://YvonneZhang.github.io/https://YvonneZhang.github.io/tag/Java-Script/" />
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Java-Script - Yvonne Zhang" />
    <meta name="twitter:url" content="https://YvonneZhang.github.io/https://YvonneZhang.github.io/tag/Java-Script/" />
    
    <script type="application/ld+json">
null
    </script>

    <meta name="generator" content="HubPress" />
    <link rel="alternate" type="application/rss+xml" title="Yvonne Zhang" href="https://YvonneZhang.github.io/rss/" />
</head>
<body class="tag-template tag-Java-Script">

<div id="outdated">
    <h6>Your browser is out-of-date!</h6>
    <p>Update your browser to view this website correctly. <a id="btnUpdate" href="http://outdatedbrowser.com/">Update my browser now</a></p>
</div>

<nav class="top-bar hide-for-large-up" data-topbar style="background: none">
  <ul class="title-area">
    <li class="name">

    </li>
    <li class="home"><a class="fi-home" href="https://YvonneZhang.github.io"></a></li>
    <li class="toggle-topbar"><a href="#" id="trigger-overlay" class="fi-list"></a></li>
  </ul>

<div class="overlay overlay-scale">
    <button type="button" class="overlay-close">Close</button>
    <nav>
        <ul>
            <li><a href="https://YvonneZhang.github.io">Home</a></li>
        </ul>
    </nav>
</div>

</nav>

<div class="row">

<div class="small-16 medium-16 large-4 columns right head-area bgimage" style="background-image: url(http://7xl4xb.com1.z0.glb.clouddn.com/DSC_0064%20%281%29.JPG)">

<header class="site-head">
    <div class="vertical">
        <div class="site-head-content inner">
            <ul class="side-nav blog-menu show-for-large-up">
                <li><a class="fi-home" href="https://YvonneZhang.github.io"></a></li>
                <li><a class="fi-torso" href="https://YvonneZhang.github.io/about"></a></li>
                <li><a class="fi-mail" href="https://YvonneZhang.github.io/contact"></a></li>
            </ul>
            <a class="blog-logo" href="https://YvonneZhang.github.io"><img alt="<NAME>" src="http://7xl4xb.com1.z0.glb.clouddn.com/favicon.ico" alt="Blog Logo" /></a>
            <h1 class="blog-title"><NAME></h1>
            <hr>
            <p class="blog-description">暂无一席地</p>
            <div class="blog-network">
<!--                 <a href="#" class="fi-social-pinterest"></a>
                <a href="#" class="fi-social-linkedin"></a>
                <a href="#" class="fi-social-behance"></a>
                <a href="#" class="fi-social-deviant-art"></a>
                <a href="#" class="fi-social-dribbble"></a>
                <a href="#" class="fi-social-flickr"></a>
                <a href="#" class="fi-social-github"></a>
                <a href="#" class="fi-social-skype"></a>
                <a href="#" class="fi-social-snapchat"></a>
                <a href="#" class="fi-social-steam"></a>
                <a href="#" class="fi-social-xbox"></a>
                <a href="#" class="fi-social-reddit"></a> -->
                  <a href="YvonneZhang" class="fi-social-github"></a>
                  <a href="YvonneZhang_LOL" class="fi-social-twitter"></a>
            </div>
        </div>
    </div>
</header>

</div>


<div class="small-16 medium-16 large-12 columns main-column left">
    


<main class="content" role="main">

        <header class="tag-archive-header">
            <h1>Java-Script</h1>
        </header>


    <article class="post tag-Java-Script">
        <header class="post-header">
            <span class="post-meta"><time datetime="2016-06-21">21 Jun 2016</time> </span>
            <h2 class="post-title"><a href="https://YvonneZhang.github.io/2016/06/21/Generator.html">Generator 函数初探</a></h2>

        </header>
        <section class="post-excerpt">
            <p>前言 Generator 函数是 ES6 一个很重要的特性，但其涉及的概念却不太能一眼就看懂，所以写下这篇小文以作学习记录。 定义一个 generator 函数 定义一个 generator 函数十分简单，和正常的函数定义相比，多加一个 * 就可以了： function * name(arguments) {   statements } 但 generator 函数与普通函数的区别却非常大，它的优势在于，退出函数之后可以再次进入，函数的上下文会被保留。每次退出 generator 函数，它都会返回一个值，这不是一个普通的值，而是一个迭代器（iterator）对象。下面就来说一说迭代器对象。 迭代器对象 迭代器有一个特别棒的特性，就是可以记录当前数组遍历到的节点位置。除此之外，按照 协议规范，迭代器对象需要提供一个 next 方法继续遍历下一个属性值，该方法返回一个如下对象： {   d&hellip;</p>
        </section>
        <a class="button read-more right small" href="https://YvonneZhang.github.io/2016/06/21/Generator.html">Read more</a>
        <aside class="tags fi-pricetag-multiple">Posted on <a href="https://YvonneZhang.github.io/tag/Java-Script/">JavaScript</a></aside>
        <div class="clearfix"></div>
    </article>


    <nav class="pagination" role="navigation">
    <span class="page-number">Page 1 of 1</span>
</nav>

</main>
</div>

</div>

    <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js?v="></script> <script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.min.js?v="></script> <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js?v="></script> 
      <script type="text/javascript">
        jQuery( document ).ready(function() {
          // change date with ago
          jQuery('ago.ago').each(function(){
            var element = jQuery(this).parent();
            element.html( moment(element.text()).fromNow());
          });
        });

        hljs.initHighlightingOnLoad();
      </script>

    <!--[if lte IE 8]>
        <script type="text/javascript" src="//YvonneZhang.github.io/themes/ichi/assets/js/outdatedBrowser.min.js?v=1468050085646"></script>
    <![endif]-->
    <script type="text/javascript" src="//YvonneZhang.github.io/themes/ichi/assets/js/min/built.js?v=1468050085646"></script>

    <script>
      $(document).foundation();
    </script>

</body>
</html>
{'fraction_non_alphanumeric': 0.19348188089762905, 'fraction_numerical': 0.02672270240266434, 'mean_word_length': 3.0178400764574707, 'pattern_counts': {'":': 0, '<': 303, '<?xml version=': 0, '>': 302, 'https://': 33, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '785189', 'n_tokens_mistral': 4896, 'n_tokens_neox': 4599, 'n_words': 626}