---
title: "JS 技巧积累"
author: "piperzero"
date: "2013-02-01T15:33:00Z"
tags: []
slug: "js"
draft: false
lastmod: "2013-02-21T19:57:42Z"
id: 1811757
url: "https://piperzero.iteye.com/blog/1811757"
---

1. ### 判断是否存在于
   
   ```
   var a = "b" in c;
   ```
2. ### 字符串转数组新写法
   
   ```
   var split = "split",
   	S = " ",
       events = "click dblclick mousedown mousemove mouseout mouseover mouseup touchstart touchmove touchend touchcancel"[split](S);
   ```

```
var h = 2;
h = ~~h;
//怎么理解？
```