![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
A_linyuan
这个作者很懒,什么都没留下…
展开
-
js数组方法整理
1.join() join,就是把数组转换成字符串,然后给他规定个连接字符,默认的是逗号( ,) 不改变原数组。 书写格式:join(" "),括号里面写字符串 (“要加引号”), let arr = [1,2,3]; console.log(arr.join()); // 1,2,3 console.log(arr.join("-")); // 1-2-3 console.log(arr); // [1, 2, 3](原数组不变) 2.栈方法 push() pop(转载 2020-09-04 11:16:33 · 146 阅读 · 0 评论 -
leetcode86 分隔链表
给定一个链表和一个特定值 x,对链表进行分隔,使得所有小于 x 的节点都在大于或等于 x 的节点之前。 你应当保留两个分区中每个节点的初始相对位置。 示例: 输入: head = 1->4->3->2->5->2, x = 3 输出: 1->2->2->4->3->5 /** * Definition for singly-linked list. * function ListNode(val) { * this.val = val原创 2020-08-25 13:08:36 · 117 阅读 · 0 评论