本文将研究 ES6 的 for ... of 循环。 旧方法 在过去,有两种方法可以遍历 JavaScript。 首先是经典的 for i 循环,它使你可以遍历数组或可索引的且有 length 属性的任何对象。 for(i=0;i<things.length;i++) { var thing = t ...
分类:
其他好文 时间:
2020-09-18 04:14:24
阅读次数:
32
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title></title> <script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script> </ ...
分类:
其他好文 时间:
2020-09-18 03:20:13
阅读次数:
37
1046 Shortest Distance (20分) #include<stdio.h> #include<iostream> using namespace std; int main() { int length[100100]; int n,n2,num=0; int c1,c2; sca ...
分类:
其他好文 时间:
2020-09-18 03:18:51
阅读次数:
29
一. 字符串拼接 concat('asdf',str); -- asdfhello 二、字符串截取 从左开始截取字符串 left(str, length) --说明:left(被截取字段,截取长度) select left('hello',3); --hel 从右开始截取字符串 right(str, ...
分类:
数据库 时间:
2020-09-18 01:38:10
阅读次数:
44
问题描述 给定一个未排序的整数数组,找出最长连续序列的长度。 要求算法的时间复杂度为 O(n)。 示例: 输入: [100, 4, 200, 1, 3, 2]输出: 4解释: 最长连续序列是 [1, 2, 3, 4]。它的长度为 4。 来源:力扣(LeetCode)链接:https://leetco ...
分类:
其他好文 时间:
2020-09-18 01:00:20
阅读次数:
25
1.归并有序数组 归并A,B到A public class Solution { public void merge(int A[], int m, int B[], int n) { int a = m-1, b = n-1; int i = A.length-1; while(a>=0 && b ...
分类:
编程语言 时间:
2020-09-18 00:11:27
阅读次数:
28
package LeetCode_463 /** * 463. Island Perimeter * https://leetcode.com/problems/island-perimeter/description/ * * You are given row x col grid repres ...
分类:
其他好文 时间:
2020-09-17 23:30:18
阅读次数:
36
Javascript 1、全选、全不选、反选的js实现: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial ...
分类:
编程语言 时间:
2020-09-17 23:12:52
阅读次数:
37
问题 K: Length of Bundle Rope 时间限制: 2 Sec 内存限制: 1024 MB提交 状态 题目描述 Due to the development of online shopping, the logistics industry which is highly conn ...
分类:
其他好文 时间:
2020-09-17 22:58:33
阅读次数:
44
const arr = [21, 2, 5, 3, 1, 2, 6, 3, 3]; function select(data) { var index; for (let i = 0; i < data.length - 1; i++) { index = i; for (let m = i; m ...
分类:
编程语言 时间:
2020-09-17 22:25:51
阅读次数:
36