摘要:
parseInt() 函数可解析一个字符串,并返回一个整数。 语法 parseInt(string, radix) 参数描述 string 必需。要被解析的字符串。 radix 可选。表示要解析的数字的基数。该值介于 2 ~ 36 之间。 如果省略该参数或其值为 0,则数字将以 10 为基础来解析。 阅读全文
摘要:
概述: 1. round是四舍五入的2. ceiling是向上取整3. float是向下取整 舍入规则: 1. Math.ceil()执行向上舍入,即它总是将数值向上舍入为最接近的整数;2. Math.floor()执行向下舍入,即它总是将数值向下舍入为最接近的整数;3. Math.round()执 阅读全文
摘要:
定义和用法 join() 方法用于把数组中的所有元素放入一个字符串。 元素是通过指定的分隔符进行分隔的。 语法 返回值 返回一个字符串。该字符串是通过把 arrayObject 的每个元素转换为字符串,然后把这些字符串连接起来,在两个元素之间插入separator 字符串而生成的。 阅读全文
摘要:
在写js脚本的时候经常遇到对象为空或者不是对象的情况,出现这种情况我们可以用if去判断它,然后去执行相应的处理方法,具体判断他们的方法有以下几种: 1、if (typeOf(x) == "undefined")2、if (typeOf(x) != "object")3、if(!x) 其中第三种是最简 阅读全文
摘要:
Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. Given an array of size 阅读全文
摘要:
Given a linked list, determine if it has a cycle in it. Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without usi 阅读全文
摘要:
Given a string s and a string t, check if s is subsequence of t. Given a string s and a string t, check if s is subsequence of t. You may assume that 阅读全文
摘要:
[转]java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x8E' for column 'nick' at row 1 mysql报错: Java.sql.SQLException: Incorrect string value 阅读全文
摘要:
需要用到的类和接口: 类:Proxy 接口:InvocationHandler InvocationHandler: 接口方法: Object invoke(Object proxy, Method method, Object[] args) throws Throwable 方法参数: Obje 阅读全文