/docs/html/api/seed/lang/unique.html
HTML | 246 lines | 204 code | 23 blank | 19 comment | 0 complexity | a90b5001be1930c0fee9ef56b858b632 MD5 | raw file
- <!doctype html>
- <html>
- <head>
- <meta charset="utf-8"/>
- <title>unique — KISSY Docs valpha documentation</title>
- <link rel="stylesheet" href="../../../static/reset.css"/>
- <link rel="stylesheet" href="../../../static/kissy.css"/>
- <link rel="stylesheet" href="../../../static/pygments.css"/>
- <link rel="shortcut icon" href="../../../static/favicon.ico"/>
- <link href='http://fonts.googleapis.com/css?family=Philosopher' rel='stylesheet' type='text/css'>
- <script>
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '../../../',
- VERSION: 'alpha',
- COLLAPSE_INDEX: false,
- FILE_SUFFIX: '.html',
- HAS_SOURCE: true
- };
- if(window.location.href.indexOf("localhost/kissy_git/")!=-1){
- document.write('<script src="http://localhost/kissy_git/kissy/build/kissy.js"'+'><'+'/script>');
- } else{
- document.write('<script src="http://yiminghe.github.com/kissy/build/kissy.js"'+'>'+'<'+'/script>');
- }
- </script>
- <script type="text/javascript" src="../../../static/jquery.js"></script>
- <script type="text/javascript" src="../../../static/underscore.js"></script>
- <script type="text/javascript" src="../../../static/doctools.js"></script>
- </head>
- <body><div id="header">
- <h1 class="logo"><a alt="KISSY" href="http://docs.kissyui.com"><img src="../../../static/logo.png"/></a></h1>
- <p class="desc">小巧灵活、简洁实用、愉悦编码、快乐开发</p>
- <ul class="navigation">
- <li><a href="../../../../html/quickstart/index.html">快速上手</a></li>
- <li><a href="../../../../html/api/index.html">API</a></li>
- <li><a href="../../../../html/demo/index.html">DEMO</a></li>
- <li><a href="http://blog.kissyui.com/">博客</a></li>
- <!--<li><a href="mailto:all@kissyui.com">论坛</a></li>-->
- <li><a href="http://www.github.com/kissyteam">源码</a></li>
- </ul>
- <div id="searchbox" style="display: none" class="searchbox">
- <form class="search" action="../../../search.html" method="get">
- <input type="text" name="q" size="28" class="ipt"/>
- <input type="submit" value="Go" class="btn"/>
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- </div>
- <script type="text/javascript">$('#searchbox').show(0);</script>
- </div>
- <div id="content">
-
- <div class="layout grid-s6m0">
- <div class="col-main">
- <div class="main-wrap">
- <div class='related'>
- <h3>Navigation</h3>
-
- <ul>
- <li class="right" style="margin-right: 10px">
- <a href="../../../genindex.html" title="General Index"
- accesskey="I">index</a></li>
- <li class="right" >
- <a href="../../../py-modindex.html" title="Python Module Index"
- >modules</a> | </li>
- <li class="right" >
- <a href="isArray.html" title="isArray"
- accesskey="N">next</a> | </li>
- <li class="right" >
- <a href="lastIndexOf.html" title="lastIndexOf"
- accesskey="P">previous</a> | </li>
- <li><a href="../../../index.html">KISSY Docs</a> » </li>
- <li><a href="../../index.html" >API文档</a> » </li>
- <li><a href="../index.html" >Seed</a> » </li>
- <li><a href="index.html" accesskey="U">lang</a> » </li>
- </ul>
- </div>
-
- <div class="section" id="unique">
- <h1>unique<a class="headerlink" href="#unique" title="Permalink to this headline">¶</a></h1>
- <div class="section" id="module">
- <h2>Module<a class="headerlink" href="#module" title="Permalink to this headline">¶</a></h2>
- <blockquote>
- <div><a class="reference internal" href="index.html#module-Lang" title="Lang"><tt class="xref py py-mod docutils literal"><span class="pre">Lang</span></tt></a></div></blockquote>
- </div>
- <div class="section" id="methods">
- <h2>Methods<a class="headerlink" href="#methods" title="Permalink to this headline">¶</a></h2>
- <dl class="function">
- <dt id="Lang.KISSY.unique">
- <tt class="descclassname">KISSY.</tt><tt class="descname">unique</tt><big>(</big><big>)</big><a class="headerlink" href="#Lang.KISSY.unique" title="Permalink to this definition">¶</a></dt>
- <dd><div class="line-block">
- <div class="line">Array <strong>KISSY.unique</strong> (arr[,keepLast=false])</div>
- <div class="line">返回一个新数组, 仅包含 arr 去重后的值</div>
- </div>
- <table class="docutils field-list" frame="void" rules="none">
- <col class="field-name" />
- <col class="field-body" />
- <tbody valign="top">
- <tr class="field"><th class="field-name" colspan="2">Parameters:</th></tr>
- <tr><td> </td><td class="field-body"><ul class="first simple">
- <li><strong>arr</strong> (<em>Array</em>) – 包含重复元素的数组</li>
- <li><strong>keepLast</strong> (<em>boolean</em>) – 遇到重复值是保留第一次出现还是保留最后一次出现的元素</li>
- </ul>
- </td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">Returns:</th></tr>
- <tr><td> </td><td class="field-body"><p class="first">包含 arr 去重后的数组</p>
- </td>
- </tr>
- <tr class="field"><th class="field-name" colspan="2">Return type:</th></tr>
- <tr><td> </td><td class="field-body"><p class="first last">Array</p>
- </td>
- </tr>
- </tbody>
- </table>
- <p>例如</p>
- <div class="highlight-javascript"><div class="highlight"><pre><span class="nx">KISSY</span><span class="p">.</span><span class="nx">unique</span><span class="p">([</span><span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">,</span> <span class="nx">a</span><span class="p">],</span><span class="kc">true</span><span class="p">)</span> <span class="o">=></span> <span class="p">[</span><span class="nx">b</span><span class="p">,</span> <span class="nx">a</span><span class="p">]</span>
- <span class="nx">KISSY</span><span class="p">.</span><span class="nx">unique</span><span class="p">([</span><span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">,</span> <span class="nx">a</span><span class="p">])</span> <span class="o">=></span> <span class="p">[</span><span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">]</span>
- </pre></div>
- </div>
- </dd></dl>
- </div>
- </div>
- <div>
- <label>
- 评论:
- <select id='openComment'>
- <option value='1'>打开</option>
- <option value='0'>关闭</option>
- </select>
- </label>
- <script>
- if(!window.localStorage){
- KISSY.one("#openComment").attr("disabled",true);
- }else{
- KISSY.one("#openComment").val(window.localStorage.getItem("kissy-commment")||"1");
- KISSY.one("#openComment").on("change",function(){
- window.localStorage.setItem("kissy-commment",KISSY.one("#openComment").val());
- window.location.reload();
- });
- }
- </script>
- </div>
- <div id="disqus_thread"></div>
- <script>
- if((window.location.hostname.indexOf("kissyui.com")!=-1 )&& window.localStorage.getItem("kissy-commment")!="0"){
- /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
- var disqus_shortname = 'kissy-docs'; // required: replace example with your forum shortname
- // The following are highly recommended additional parameters. Remove the slashes in front to use.
- //var disqus_identifier = '/anim';
- //var disqus_url = window.location;
- /* * * DON'T EDIT BELOW THIS LINE * * */
- (function() {
- var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
- dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
- (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
- })();
- }
- </script>
- <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
- <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
- <!--<div id="google-search-box">
- <div id="cse" style="width: 100%;">Loading</div>
- <script>
- if(window.location.hostname.indexOf("kissyui.com")!=-1){
- document.write('<script src="http://www.google.com/jsapi" type="text/javascript"><'+'/script>');
- }
- </script>
- <script>
- if(window.location.hostname.indexOf("kissyui.com")!=-1){
- google.load('search', '1', {language : 'zh-CN', style : google.loader.themes.MINIMALIST});
- google.setOnLoadCallback(function() {
- var customSearchControl = new google.search.CustomSearchControl('012347804910294994683:n4uzb24gqdm');
- customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
- customSearchControl.draw('cse');
- }, true);
- }
- </script>
- </div>-->
- </div>
- </div>
- <div class="col-sub"><ul class="s-box api-toctree">
- <h2 class="s-box-hd">Seed</h2>
- <ul class="s-box-bd">
- <li><a href="../loader/index.html">Loader</a></li>
- <li><a href="../kissy/index.html">kissy</a></li>
- <li><a href="index.html">lang</a></li>
- <li><a href="../web/index.html">web</a></li>
- </ul>
- </ul>
- <ul class="s-box core-toctree">
- <h2 class="s-box-hd">Core</h2>
- <ul class="s-box-bd">
- <li><a href="../../core/ua/index.html">ua</a></li>
- <li><a href="../../core/dom/index.html">DOM</a></li>
- <li><a href="../../core/event/index.html">event</a></li>
- <li><a href="../../core/node/index.html">node</a></li>
- <li><a href="../../core/json/index.html">json</a></li>
- <li><a href="../../core/ajax/index.html">ajax</a></li>
- <li><a href="../../core/cookie/index.html">cookie</a></li>
- <li><a href="../../core/base/index.html">base</a></li>
- <li><a href="../../core/anim/index.html">anim</a></li>
- </ul>
- </ul>
- <ul class="s-box component-toctree">
- <h2 class="s-box-hd">Component</h2>
- <ul class="s-box-bd">
- <li><a href="https://github.com/jquery/sizzle/wiki/Sizzle-Home">sizzle</a></li>
- <li><a href="../../component/template/index.html">template</a></li>
- <li><a href="../../component/datalazyload/index.html">datalazyload</a></li>
- <li><a href="../../component/flash/index.html">flash</a></li>
- <li><a href="../../component/dd/index.html">dd</a></li>
- <li><a href="../../component/switchable/index.html">switchable</a></li>
- <li><a href="../../component/suggest/index.html">suggest</a></li>
- <li><a href="../../component/calendar/index.html">calendar</a></li>
- <li><a href="../../component/imagezoom/index.html">imagezoom</a></li>
- <li><a href="../../component/overlay/index.html">overlay</a></li>
- </ul>
- </ul>
-
- </div>
- </div>
- </div>
- <div id="footer">
- © Copyright 2010~2011, KISSY Team. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>
- </div>
- </body>
- </html>