PageRenderTime 66ms CodeModel.GetById 35ms RepoModel.GetById 1ms app.codeStats 0ms

/1.2/docs/html/api/seed/lang/unique.html

https://github.com/kissyteam/kissyteam.github.com
HTML | 278 lines | 230 code | 30 blank | 18 comment | 0 complexity | b9056a3d3c4f29238250826db7cd2656 MD5 | raw file
Possible License(s): Apache-2.0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8"/>
  5. <title>unique &mdash; KISSY v1.2 Documentation</title>
  6. <link rel="stylesheet" href="http://a.tbcdn.cn/s/kissy/1.2.0/css/reset.css"/>
  7. <link rel="stylesheet" href="../../../_static/kissy.css"/>
  8. <link rel="stylesheet" href="../../../_static/pygments.css"/>
  9. <link rel="shortcut icon" href="http://a.tbcdn.cn/s/kissy/favicon.ico" type="image/x-icon" />
  10. <link href='http://fonts.googleapis.com/css?family=Philosopher' rel='stylesheet' type='text/css'>
  11. <script>
  12. var DOCUMENTATION_OPTIONS = {
  13. URL_ROOT: '../../../',
  14. VERSION: '',
  15. COLLAPSE_INDEX: false,
  16. FILE_SUFFIX: '.html',
  17. HAS_SOURCE: true
  18. };
  19. (function(){
  20. var js=[],h=window.location.href,d=document;
  21. js.push("../../../_static/jquery.js");
  22. js.push("../../../_static/underscore.js");
  23. js.push("../../../_static/doctools.js");
  24. for(var i=0;i<js.length;i++){
  25. var j=js[i];
  26. if(h.indexOf("localhost/kissy_git/")==-1&&j.indexOf("jquery.js")!=-1){
  27. d.write('<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"><\/script>');
  28. }else{
  29. d.write('<script type="text/javascript" src="'+ j +'"><\/script>');
  30. }
  31. }
  32. })();
  33. </script>
  34. <script>
  35. var _gaq = _gaq || [];
  36. _gaq.push(['_setAccount', 'UA-31470541-1']);
  37. _gaq.push(['_trackPageview']);
  38. (function() {
  39. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  40. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  41. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  42. })();
  43. </script>
  44. </head>
  45. <body><div id="header">
  46. <h1 class="logo"><a alt="KISSY" href="http://docs.kissyui.com">
  47. <img src="http://a.tbcdn.cn/s/kissy/logo.png" />
  48. </a></h1>
  49. <ul class="navigation">
  50. <li><a href="http://docs.kissyui.com">首页</a></li>
  51. <li><a href="../../../../html/tutorials/index.html" >Tutorials</a></li>
  52. <li><a href="../../../../html/api/index.html" >API</a></li>
  53. <li><a href="../../../../html/demo/index.html" >DEMO</a></li>
  54. <li><a href="https://groups.google.com/group/kissy-ui" >Google Group</a></li>
  55. <li><a href="http://www.github.com/kissyteam" >Source Code</a></li>
  56. <li><a href="http://docs.kissyui.com/kissy/docs/" >English API Docs</a></li>
  57. </ul>
  58. <div id="searchbox" style="display: none" class="searchbox">
  59. <form class="search" action="../../../search.html" method="get">
  60. <input type="text" name="q" size="28" class="ipt"/>
  61. <input type="submit" value="Go" class="btn"/>
  62. <input type="hidden" name="check_keywords" value="yes" />
  63. <input type="hidden" name="area" value="default" />
  64. </form>
  65. </div>
  66. <script type="text/javascript">$('#searchbox').show(0);</script>
  67. </div>
  68. <div id="content">
  69. <div class="layout grid-s6m0">
  70. <div class="col-main">
  71. <div class="main-wrap">
  72. <div class='related'>
  73. <h3>Navigation</h3>
  74. <ul>
  75. <li class="right" style="margin-right: 10px">
  76. <a href="../../../genindex.html" title="General Index"
  77. accesskey="I">index</a></li>
  78. <li class="right" >
  79. <a href="../../../py-modindex.html" title="Python Module Index"
  80. >modules</a> | </li>
  81. <li class="right" >
  82. <a href="isArray.html" title="isArray"
  83. accesskey="N">next</a> | </li>
  84. <li class="right" >
  85. <a href="lastIndexOf.html" title="lastIndexOf"
  86. accesskey="P">previous</a> | </li>
  87. <li><a href="../../../index.html">KISSY v1.2 Documentation</a> &#187; </li>
  88. <li><a href="../../index.html" >API Documentation</a> &#187; </li>
  89. <li><a href="../index.html" >Seed</a> &#187; </li>
  90. <li><a href="index.html" accesskey="U">lang</a> &#187; </li>
  91. </ul>
  92. </div>
  93. <div class="section" id="unique">
  94. <h1>unique<a class="headerlink" href="#unique" title="Permalink to this headline"></a></h1>
  95. <div class="section" id="module">
  96. <h2>Module<a class="headerlink" href="#module" title="Permalink to this headline"></a></h2>
  97. <blockquote>
  98. <div><a class="reference internal" href="../index.html#module-seed" title="seed"><tt class="xref py py-mod docutils literal"><span class="pre">seed</span></tt></a></div></blockquote>
  99. </div>
  100. <div class="section" id="methods">
  101. <h2>Methods<a class="headerlink" href="#methods" title="Permalink to this headline"></a></h2>
  102. <dl class="function">
  103. <dt id="seed.KISSY.unique">
  104. <tt class="descclassname">KISSY.</tt><tt class="descname">unique</tt><big>(</big><big>)</big><a class="headerlink" href="#seed.KISSY.unique" title="Permalink to this definition"></a></dt>
  105. <dd><div class="line-block">
  106. <div class="line">Array <strong>KISSY.unique</strong> (arr[,keepLast=false])</div>
  107. <div class="line">返回一个新数组, 仅包含 arr 去重后的值</div>
  108. </div>
  109. <table class="docutils field-list" frame="void" rules="none">
  110. <col class="field-name" />
  111. <col class="field-body" />
  112. <tbody valign="top">
  113. <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
  114. <li><strong>arr</strong> (<em>Array</em>) &#8211; 包含重复元素的数组</li>
  115. <li><strong>keepLast</strong> (<em>boolean</em>) &#8211; 遇到重复值是保留第一次出现还是保留最后一次出现的元素</li>
  116. </ul>
  117. </td>
  118. </tr>
  119. <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">包含 arr 去重后的数组</p>
  120. </td>
  121. </tr>
  122. <tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">Array</p>
  123. </td>
  124. </tr>
  125. </tbody>
  126. </table>
  127. <p>例如</p>
  128. <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">=&gt;</span> <span class="p">[</span><span class="nx">b</span><span class="p">,</span> <span class="nx">a</span><span class="p">]</span>
  129. <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">=&gt;</span> <span class="p">[</span><span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">]</span>
  130. </pre></div>
  131. </div>
  132. </dd></dl>
  133. </div>
  134. </div>
  135. <div class='related'>
  136. <h3>Navigation</h3>
  137. <ul>
  138. <li class="right" style="margin-right: 10px">
  139. <a href="../../../genindex.html" title="General Index"
  140. accesskey="I">index</a></li>
  141. <li class="right" >
  142. <a href="../../../py-modindex.html" title="Python Module Index"
  143. >modules</a> | </li>
  144. <li class="right" >
  145. <a href="isArray.html" title="isArray"
  146. accesskey="N">next</a> | </li>
  147. <li class="right" >
  148. <a href="lastIndexOf.html" title="lastIndexOf"
  149. accesskey="P">previous</a> | </li>
  150. <li><a href="../../../index.html">KISSY v1.2 Documentation</a> &#187; </li>
  151. <li><a href="../../index.html" >API Documentation</a> &#187; </li>
  152. <li><a href="../index.html" >Seed</a> &#187; </li>
  153. <li><a href="index.html" accesskey="U">lang</a> &#187; </li>
  154. </ul>
  155. </div>
  156. <div id="disqus_thread"></div>
  157. <script>
  158. if((window.location.hostname.indexOf("kissyui.com")!=-1 )&& window.localStorage.getItem("kissy-commment")!="0"){
  159. /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
  160. var disqus_shortname = 'kissy-docs'; // required: replace example with your forum shortname
  161. // The following are highly recommended additional parameters. Remove the slashes in front to use.
  162. //var disqus_identifier = '/anim';
  163. //var disqus_url = window.location;
  164. /* * * DON'T EDIT BELOW THIS LINE * * */
  165. (function() {
  166. var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
  167. dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
  168. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  169. })();
  170. }
  171. </script>
  172. <!--<div id="google-search-box">
  173. <div id="cse" style="width: 100%;">Loading</div>
  174. <script>
  175. if(window.location.hostname.indexOf("kissyui.com")!=-1){
  176. document.write('<script src="http://www.google.com/jsapi" type="text/javascript"><'+'/script>');
  177. }
  178. </script>
  179. <script>
  180. if(window.location.hostname.indexOf("kissyui.com")!=-1){
  181. google.load('search', '1', {language : 'zh-CN', style : google.loader.themes.MINIMALIST});
  182. google.setOnLoadCallback(function() {
  183. var customSearchControl = new google.search.CustomSearchControl('012347804910294994683:n4uzb24gqdm');
  184. customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
  185. customSearchControl.draw('cse');
  186. }, true);
  187. }
  188. </script>
  189. </div>-->
  190. </div>
  191. </div>
  192. <div class="col-sub"><ul class="s-box api-toctree">
  193. <h2 class="s-box-hd">Seed</h2>
  194. <ul class="s-box-bd">
  195. <li><a href="../loader/index.html">loader</a></li>
  196. <li><a href="../kissy/index.html">kissy</a></li>
  197. <li><a href="index.html">lang</a></li>
  198. <li><a href="../web/index.html">web</a></li>
  199. </ul>
  200. </ul>
  201. <ul class="s-box core-toctree">
  202. <h2 class="s-box-hd">Core</h2>
  203. <ul class="s-box-bd">
  204. <li><a href="../../core/ua/index.html">ua</a></li>
  205. <li><a href="../../core/dom/index.html">dom</a></li>
  206. <li><a href="../../core/event/index.html">event</a></li>
  207. <li><a href="../../core/node/index.html">node</a></li>
  208. <li><a href="../../core/json/index.html">json</a></li>
  209. <li><a href="../../core/ajax/index.html">ajax</a></li>
  210. <li><a href="../../core/cookie/index.html">cookie</a></li>
  211. <li><a href="../../core/base/index.html">base</a></li>
  212. <li><a href="../../core/anim/index.html">anim</a></li>
  213. </ul>
  214. </ul>
  215. <ul class="s-box component-toctree">
  216. <h2 class="s-box-hd">Component</h2>
  217. <ul class="s-box-bd">
  218. <li><a href="https://github.com/jquery/sizzle/wiki/Sizzle-Home">sizzle</a></li>
  219. <li><a href="../../component/mvc/index.html">mvc</a></li>
  220. <li><a href="../../component/template/index.html">template</a></li>
  221. <li><a href="../../component/datalazyload/index.html">datalazyload</a></li>
  222. <li><a href="../../component/flash/index.html">flash</a></li>
  223. <li><a href="../../component/dd/index.html">dd</a></li>
  224. <li><a href="../../component/resizable/index.html">resizable</a></li>
  225. <li><a href="../../component/switchable/index.html">switchable</a></li>
  226. <li><a href="../../component/suggest/index.html">suggest</a></li>
  227. <li><a href="../../component/calendar/index.html">calendar</a></li>
  228. <li><a href="../../component/imagezoom/index.html">imagezoom</a></li>
  229. <li><a href="../../component/overlay/index.html">overlay</a></li>
  230. <li><a href="../../component/uibase/index.html">uibase</a></li>
  231. <li><a href="../../component/component/index.html">component</a></li>
  232. <li><a href="../../component/button/index.html">button</a></li>
  233. <li><a href="../../component/menu/index.html">menu</a></li>
  234. <li><a href="../../component/menubutton/index.html">menubutton</a></li>
  235. <li><a href="../../component/tree/index.html">tree</a></li>
  236. <li><a href="../../component/waterfall/index.html">waterfall</a></li>
  237. <li><a href="http://docs.kissyui.com/kissy/src/validation/demo/" target="_blank">validation</a></li>
  238. <li><a href="../../component/editor/index.html">editor</a></li>
  239. </ul>
  240. </ul>
  241. </div>
  242. </div>
  243. </div>
  244. <div id="footer">
  245. &copy; Copyright 2010~2012, KISSY Team. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>
  246. </div>
  247. </body>
  248. </html>