
JavaScript
攻城匠
终将富有~
展开
-
[LeetCode] Find Anagram Mappings - JS
描述 Given two lists Aand B, and B is an anagram of A. B is an anagram of A means B is made by randomizing the order of the elements in A. We want to find an index mapping P, from A to B. A mapping P[原创 2018-01-17 12:03:07 · 221 阅读 · 0 评论 -
[LintCode] 链表节点计数 - JS
描述 计算链表中有多少个节点. 样例 给出 1->3->5, 返回 3. 源码 /** * @param head: the first node of linked list. * @return: An integer */ const countNodes = function (head) { var count = 0; var cur = head原创 2018-01-17 14:27:04 · 605 阅读 · 0 评论 -
聊一聊js的变量提升
写在前面 今天做了变量提升的题目,发现自己还是一知半解的状态,以后搞清楚一个技术点就写下来记录一下,尽管自己可能也不知道怎么表达的会让大家看的懂,就先慢慢的一步步前进吧,写多了总比不写好呀。 粗略讲解 1:你认为运行 getClothing(false) 后的输出是什么? function getClothing(isCold) { if (isCold) { va原创 2018-01-19 22:40:30 · 210 阅读 · 0 评论