Skip to content

Commit

Permalink
add support writers
Browse files Browse the repository at this point in the history
  • Loading branch information
loverajoel committed Aug 10, 2016
1 parent 099520e commit 5e59479
Show file tree
Hide file tree
Showing 48 changed files with 89 additions and 5 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Use [this format](https://github.com/loverajoel/jstips/blob/gh-pages/POST_TEMPLA
- Mark JS code with ```js
- Don't mention "JavaScript" in the title (as our tips are about it anyway)
- Use backticks (`) to mark code in the **title** and/or **tip-tldr** fields. _Warning_: Both values must not start with backticks!
- **Tip**, if you want, you can add your url (Paypal, Coinbase, etc ) in **tip-writer-support** field and receive the congratulations of readers. If you have an old tip, you can add it and send a PR.

Once your tip is ready, [issue a pull request](https://help.github.com/articles/using-pull-requests/) with this [PR template](https://github.com/loverajoel/jstips/blob/gh-pages/PULL_REQUEST_TEMPLATE.md) and your tip will be reviewed (see below).

Expand Down
2 changes: 2 additions & 0 deletions POST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ tip-number: xx
tip-username: tip_js
tip-username-profile: https://twitter.com/tips_js
tip-tldr: Just a demo
<!-- tip-writer-support: Paypal, Coinbase, Etc -->
<!-- tip-translator-support: Paypal, Coinbase, Etc -->

categories:
- en
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ This is an awesome project about short and useful JavaScript tips that will allo

Tips are added frequently (read further if you want to stay in touch).

## Support the community
Well, if you like a tip or a writer, if you read in a specific language, you can support the writer and translator. Just send a tip and let them know the awesome work that they are doing!

### Can you help us enrich it?
Sure, you can help the project in two ways, sending your tip or reviewing future tips.
Any improvements or suggestions are more than welcome!
Expand Down
9 changes: 8 additions & 1 deletion _layouts/post.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
layout: default
is_post: true
joel: hola
---

<article class="post single">
Expand All @@ -20,6 +19,14 @@ <h1 class="post-title">

<div class="contributor meta-item"><i class="fa fa-user"></i><a href="{{ page.tip-username-profile }}" target="_blank"> @{{ page.tip-username }}</a></div>

{% if page.tip-writer-support %}
<div class="contributor meta-item"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAADNUlEQVRoQ82aj7FNMRDGv1cBKkAFqAAVoAJUgApQASpABagAFaACVIAKmJ/JmjhnT7K5yT25O/PmvXl3k91vk/2be6YxdF7SA0m3JV1NW36W9FbSC0k/x4hZ73I2YON7kp5JAoRHKP9I0qsBslZb9AJA+ZdBxe4fA0QPACz+tWD5JS5O4vLo69QD4Imkx0HrG9tTSawbRj0APmUOG1UIx74WZY7w9QD4HRHg8JRkXkrRDJ6Hkf1PCQDXEaXxrbDD9wD4IOl6xEoZz0dJNxZrUPj94jpeiDp7DwCsRfxvIfLB82yBp7wHclNGD4AWxbd4vUDQFKlmAtgKwzclcT1D1AOAiIEPcKf5mxpoq5wwZUhmKEeNxFXy+Jt0amJOWqAohRtlxGj6nowR3rcFANayUBcW0MjY5MDsHQWA1d+0WqdRediPAgDlidO1+32AvqslBoC+wvyluG/tBPZUPj8BqlwCQzUjlwBgceI0G+1FnACNT95jFEGUALDR3b00z+S8XsjlKlHBfvN0MQCUBIRFmO4kRo5xBlFyW19t8skdJLgVAcAy4peUXAABmBnWLxnMzdAAMIexCpC7/2OG6Ssy3WYIANaYGABCGDH/FIkShGIPMH8JADjJuVSf8CHZFhAziHIbJSGucbXnBsCsaLM00LJX4PPq4AAAxHmOhFOYSV4Xhm7FaGhhlLBFh8XVmQWkC0Bu+UOnDb2n53VioSu0FHxIs96rvK1HYTIxRB6qDsG8UmImgGZDeAAOmTY0Cx61wANQ9fxRwkfss1WNkkxujRBw7D22ABBW6QVOid4lp/5XRqBcqR9g7MH04RSIyOROQWodGRHpymQEv1K14L6z1XpiSuvZIGiwrMBb2bIGgAUzQXQ19TnaGQVfVfmaEy+Pa8+yOzzgilyhvE6pNhiDHD48Ym8BsGdy2wybSwO1ALDmv2ZkJszQxQUj/2fiQZKs9Rzw8aZcpSiA6KSCAdR/mdLRILpX6J0sCoBHDAa8JQo7XsottQfC0EtNFABh1L6JwhXwsjPfSgm97aYBmlemMFzjBO2bLu44MbdiFIBneU4FMPZD7RT9Rgp1DWBNWX6H38VyZf4A7T2UJ/rOgjgAAAAASUVORK5CYII=" target="_blank" width="13" height="13" /><a href="{{ page.tip-writer-support }}" target="_blank" onClick="ga('send', 'event', 'Support this writer', 'Click', '{{ page.tip-username }}');"> Support this writer</a></div>
{% endif %}

{% if page.tip-translator-support %}
<div class="contributor meta-item"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAADtklEQVRoQ92agZENQRCG/4sAESACRIAIEAEiQASIABFwESACRIAIkAERUN/Vtlr7dqa7Z2bfbemqq6u6N7vTf/893X/PvROdn12X9EjSA0k/JX2Zfj5K+jT9Le3dSfqJvgcuSroj6bEkANUMgC8lvc+AOwYgA3FXEj8t9kbSc0nfvYe3BAQTACClRhmMAYwUXbXRgAwEQGBmCwPMPUmctQMbAeiWpPsTG1uBWPP9oSRS8R9rBYTjVqGubEFD8J03psr4d3kLIKrThw1TKojlbNmrqWI2A4KZz5LOkxVz/nSt4GQZettRejOR99Z+LfWxDCCa4QtvpyN9fru3ypFipNoxq1gpNqupZoujDFEEKM97sCI7OBcBRKd/vQckkopnJ8oQKfZtJ6mGz08mwVqMr8fQM0lPE+z8knQhsT679JKnvGuAWtghvykgVMRrK94y59zMopjWM0a4ar0GKMvOQdeepSqCkgBRXLw5qIR3VbstF9cAcXaiiqBaSqdNe5oyqYwvxbEhUhR+B1NjjZnlo8wxiNlWiwTs7N01hpg3avnOJsj31blk5vmIsn+gqkuRqQHypE4kp0cocwpJuKnXAOEMcqdkXtXpLQK2b1UZZIoCa7mUuFwBVQsI6qL3PiHFjneG+Nw7zFcXNzGwwjhOukYrZCle4co2f4GnFGppt5QhAKF39QLBP8BwbribS5kHqJR286oDANIrfHAdD5vBRFJuLe3m1Q0pAphRcxJqmnOXZibSWG3NPO3mlW1Ef5mTRYMmZV01UGM4knI8T8QQm1YEYAYpM8IIEkCaWckUBVsLG5wRfo+4+eGcvJuAuPfVmahFGeKdpB5R9BREbX/OCK0AMF2pVdokA8jegTPcYWcMRmCXZze1FkCeaF063F25MhFoAYTCpolGDDCcvU3Sa82BDCAcgx1+M3l6Np+TaL5DD3/vGbIGikLAsVoP+jEVDjsvtjalmr1o9QKycZwqh2OkEFWP/gFj3PSgjElHq2CUd66OTXETCPrYphZJuWUTJe2QP7UUKgnVyFDYBTgCaK0IwJCxATOwgZKAtdroEL4baEUVAcTU2nr1tPRr87SLAIre/kSDGtkz+q6DdZGX/3eATGk3R232oPvfg95NIgy1aLeSX7soCiMHuV2UbaLtXWdFMgUFMeICpbpXJOV4wYgJla+z7Gp8yKjsZRQ3Pzu2YZQhW98C6mhgcDILyNKPMbp2Rcy6peqOnLPuNS2AbFO7OEEW2b8f6TP0LQTswTelur0NvOAPYRy1NRXSErMAAAAASUVORK5CYII=" target="_blank" width="13" height="13" /><a href="{{ page.tip-translator-support }}" target="_blank" onClick="ga('send', 'event', 'Support this translator', 'Click', '{{ page.tip-translator-support }}');"> Support this translator</a></div>
{% endif %}

<div id="social" class="share meta-item social-sharer minimalism">

</div>
Expand Down
2 changes: 1 addition & 1 deletion _posts/en/2015-12-29-insert-item-inside-an-array.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tip-number: 00
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: Inserting an item into an existing array is a daily common task. You can add elements to the end of an array using push, to the beginning using unshift, or to the middle using splice.

tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- en
Expand Down
1 change: 1 addition & 0 deletions _posts/en/2016-01-01-angularjs-digest-vs-apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 01
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: JavaScript modules and build steps are getting more numerous and complicated, but what about boilerplate in new frameworks?
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- en
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 02
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: The key is an attribute that you must pass to all components created dynamically from an array. It's a unique and constant id that React uses to identify each component in the DOM and to know whether it's a different component or the same one. Using keys ensures that the child component is preserved and not recreated and prevents weird things from happening.
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- en
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 04
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: Javascript has a native method **sort** that allows sorting arrays. Doing a simple `array.sort()` will treat each array entry as a string and sort it alphabetically. But when you try order an array of non ASCII characters you will obtain a strange result.
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- en
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 05
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: Understanding the differences between `undefined` and `null`.
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- en
Expand Down
1 change: 1 addition & 0 deletions _posts/en/2016-01-10-check-if-a-property-is-in-a-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 10
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: These are ways to check if a property is present in an object.
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- en
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 32
tip-username: loverajoel
tip-username-profile: https://twitter.com/loverajoel
tip-tldr: An Object it is an unordered collection of properties... that means that if you are trying to save ordered data inside an Object, you have to review it because properties order in objects are not guaranteed.
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- en
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 38
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: Three different solutions to merge multidimensional array into a single array.
tip-writer-support: https://www.coinbase.com/loverajoel


categories:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 45
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: Ways to use the built-in functions Math.max() and Math.min() with arrays of numbers
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- en
Expand Down
1 change: 1 addition & 0 deletions _posts/en/2016-02-15-detect-document-ready-in-pure-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 46
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: The cross-browser way to check if the document has loaded in pure JavaScript
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- en
Expand Down
1 change: 1 addition & 0 deletions _posts/en/2016-08-02-copy-to-clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 56
tip-username: loverajoel
tip-username-profile: https://twitter.com/loverajoel
tip-tldr: This week I had to create a common "Copy to Clipboard" button, I've never created one before and I want to share how I made it.
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- en
Expand Down
1 change: 1 addition & 0 deletions _posts/es_ES/2015-12-29-insert-item-inside-an-array.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 00
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: La inserción de un elemento en un array existente, es una tarea común diaria. Se pueden añadir elementos al final de un array mediante push, al principio usando unshift, al medio que usa splice.
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- es_ES
Expand Down
1 change: 1 addition & 0 deletions _posts/es_ES/2016-01-01-angularjs-digest-vs-apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 01
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: Los pasos para crear modulos en Javascript son cada vez más numerosos y complicados, pero ¿qué hay de los boilerplate en los nuevos frameworks?
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- es_ES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 02
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: La key es un atributo que se debe pasar a todos los componentes creados dinámicamente a partir de un array. Es un identificador único y constante que React usa para identificar cada componente en el DOM y saber si se trata de un componente diferente o el mismo. Utilizando keys asegura que el componente secundario se conserve y no se cree nuevamente y evita que cosas extrañas sucedan.
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- es_ES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 04
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: Javascript tiene un método nativo **sort** que permite ordenar matrices. Haciendo un simple `array.sort()` va a tratar a cada entrada del array como una cadena y va a tratar de ordenarla alfabéticamente. Pero cuando intenta ordenar un array de caracteres no ASCII obtendrá un resultado extraño.
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- es_ES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 05
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: Comprendiendo las diferencias entre `undefined` y `null`.
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- es_ES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 10
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: Estas son formas de comprobar si una propiedad está presente en un objeto.
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- es_ES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 32
tip-username: loverajoel
tip-username-profile: https://twitter.com/loverajoel
tip-tldr: Un objeto es una colección desordenada de propiedades... que significa que si está tratando de guardar los datos ordenados dentro de un objeto, hay que revisarlo debido a que las propiedades de orden en los objetos no están garantizados.
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- es_ES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 38
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: Tres soluciones diferentes para combinar arrays multidimensional en un sola arrays.
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- es_ES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 45
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: Formas de utilizar las funciones Math.max() y Math.min() con array de números
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- es_ES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 46
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: La forma cross-browser para comprobar si el DOM se ha cargado en JavaScript puro.
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- es_ES
Expand Down
2 changes: 1 addition & 1 deletion _posts/zh_CN/2015-12-29-insert-item-inside-an-array.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tip-number: 00
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: 向一个数组中插入元素是平时很常见的一件事情。你可以使用push在数组尾部插入元素,可以用unshift在数组头部插入元素,也可以用splice在数组中间插入元素。

tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_CN
Expand Down
2 changes: 1 addition & 1 deletion _posts/zh_CN/2016-01-01-angularjs-digest-vs-apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tip-number: 01
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: JavaScript模块和构建步骤越来越复杂和多样化,但是新框架里的样板是什么样子的呢?

tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_CN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 02
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: key是必须传递给从数组中动态创建的所有组件的一个值。它是一个唯一且固定的id,用来识别DOM中的每个组件,也可以让我们区别它是否是同一个组件。使用key可以确保子容器是可保存而且不需要重复创建的,还可以防止奇怪的事情发生。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_CN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 04
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: Javascript有一个原生方法**sort**可以排列数组。一次简单的`array.sort()`将每一个数组元素视为字符串并按照字母表排列。但是当你试图整理一个非ASCII元素的数组时,你可能会得到一个奇怪的结果。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_CN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 05
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: 理解`undefined`与`null`的区别。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_CN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 10
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: 这是一些检查某对象是否有某属性的方法。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_CN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 32
tip-username: loverajoel
tip-username-profile: https://twitter.com/loverajoel
tip-tldr: 对象是一个无序的对象集合。这意味着如果你想在对象里保存有序的数据,你需要重新处理它,因为对象里的数据不保证是有序的。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_CN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 38
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: 将多位数组转化为单一数组的三种不同方法。
tip-writer-support: https://www.coinbase.com/loverajoel


categories:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 45
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: 对于纯数字数组,使用内置函数Math.max()和Math.min()的方法。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_CN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 46
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: 跨浏览器且纯JavaScript检测document是否加载完成。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_CN
Expand Down
1 change: 1 addition & 0 deletions _posts/zh_CN/2016-08-02-copy-to-clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 56
tip-username: loverajoel
tip-username-profile: https://twitter.com/loverajoel
tip-tldr: 本周我做了一个简单的“复制到剪贴板”按钮,这是我第一次做这种功能,向大家分享一下我的实现方法。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_CN
Expand Down
1 change: 1 addition & 0 deletions _posts/zh_TW/2015-12-29-insert-item-inside-an-array.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 00
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: 在一個存在的陣列加入新的元素是一件很常見的事情,你可以使用 push 將元素加入到陣列的末端,或是使用 unshift 在陣列起始位置加入元素,也可以使用 splice 在陣列中間的地方加入元素。
tip-writer-support: https://www.coinbase.com/loverajoel


categories:
Expand Down
1 change: 1 addition & 0 deletions _posts/zh_TW/2016-01-01-angularjs-digest-vs-apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 01
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: JavaScript 模組以及建構步驟變得更多更複雜,但對於新的框架樣板呢?
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_TW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 02
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: 你可以從陣列動態建立 key 屬性並傳送到所有的元件(component)。它是一個唯一以及固定的 id,React 用來識別 DOM 裡面的每個元件,並區別它是否為同一個元件。使用 keys 可以確保子元件被保護而不會被重覆建立,也可以防止奇怪的事件發生。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_TW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 04
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: JavaScript 原生的 **sort** 方法讓我們可以排序陣列。做一個簡單的 `array.sort()`, 將每一個陣列元素視為字串並依字母排序。但是當你嘗試排序一個非 ASCII 字元陣列時,你會得到一個奇怪的結果。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_TW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 05
tip-username: loverajoel
tip-username-profile: https://github.com/loverajoel
tip-tldr: 了解 `undefined` 和 `null` 的差別。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_TW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 32
tip-username: loverajoel
tip-username-profile: https://twitter.com/loverajoel
tip-tldr: 物件是一個沒有排序的屬性集合...意思說,如果你想嘗試在你的物件儲存已排序的資料,你需要重新檢查,因為屬性在物件不保證是有排序的。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_TW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ tip-number: 38
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: 三種不同的解決方法,將多維陣列合併為單一的陣列。

tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_TW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 45
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: 在數字陣列使用內建的 Max.max() 和 Max.min() 函式的方式。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_TW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 46
tip-username: loverajoel
tip-username-profile: https://www.twitter.com/loverajoel
tip-tldr: 可以跨瀏覽器,而且使用 pure JavaScript 來確認文件是否已經載入完成。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_TW
Expand Down
1 change: 1 addition & 0 deletions _posts/zh_TW/2016-08-02-copy-to-clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ tip-number: 56
tip-username: loverajoel
tip-username-profile: https://twitter.com/loverajoel
tip-tldr: 本週我建立了一個常見的「複製到剪貼版」按鈕,我以前不曾做過這樣的功能,我想分享我如何實作它。
tip-writer-support: https://www.coinbase.com/loverajoel

categories:
- zh_TW
Expand Down
Loading

0 comments on commit 5e59479

Please sign in to comment.