zhangguixu/sourcecode/sourcecode-2

Claude Code and agent skill by zhangguixu/sourcecode

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Install

npx vskill@latest install zhangguixu/sourcecode/sourcecode-2

SKILL.md

JavaScript小技巧

来源:https://annatarhe.github.io/2016/04/19/hack-js-code.html

类型转换

1. 转为boolean

javascript
!!'foo' // true
!!0 //false

2. 转为number

javascript
+'45'
+new Date //转为数字

***3. ~~*

~是一个按位取非的操作,返回数值的反码,是二进制操作,JavaScript中的number都是double类型的,在位操作的时候会转化为int,两次就还是原来的数

javascript
~~3.1415 // 3 等同于parseInt()
~~5.678 //5

IIFE

创建一个函数作用域,防止全局污染,

javascript
(function (arg) {
//作用域
});

Closure

闭包:有权访问外部函数作用域的函数,作用是封装,保存变量的状态

javascript
var counter = function() {
counter = 0 ;
return function() {
return count++;
}
}

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
57
Repository forks
30
7-day trend score
20

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/zhangguixu/sourcecode/sourcecode-2/badge)](https://verified-skill.com/skills/zhangguixu/sourcecode/sourcecode-2)

Something wrong with this skill or its page? Tell us.