06 2018 档案

摘要:* 给定字符串 str,检查其是否包含连续重复的字母(a-zA-Z),包含返回 true,否则返回 false input: 'rattler' output: true * 给定字符串 str,检查其是否以元音字母结尾1、元音字母包括 a,e,i,o,u,以及对应的大写2、包含返回 true,否则 阅读全文
posted @ 2018-06-30 23:54 zhanghui_ming 阅读(170) 评论(0) 推荐(0) 编辑
摘要:* 获取数字 num 二进制形式第 bit 位的值。注意: 1、bit 从 1 开始2、返回 0 或 13、举例:2 的二进制为 10,第 1 位为 0,第 2 位为 1 input: 128, 8 output: 1 * 给定二进制字符串,将其换算成对应的十进制数字 input: '1100000 阅读全文
posted @ 2018-06-30 21:56 zhanghui_ming 阅读(128) 评论(0) 推荐(0) 编辑
摘要:* module 完成函数 createModule,调用之后满足如下要求:1、返回一个对象2、对象的 greeting 属性值等于 str1, name 属性值等于 str23、对象存在一个 sayIt 方法,该方法返回的字符串为 greeting属性值 + ', ' + name属性值 阅读全文
posted @ 2018-06-30 21:52 zhanghui_ming 阅读(187) 评论(0) 推荐(0) 编辑
摘要:Function.prototype.apply apply接受2个参数, 第1个指定了函数体内this对象的指向, 第2个参数为一个数组或者Array like的集合. apply方法吧这个集合中的元素作为参数传递给被调用的函数. Function.prototype.call 包装apply. 阅读全文
posted @ 2018-06-30 21:22 zhanghui_ming 阅读(115) 评论(0) 推荐(0) 编辑
摘要:* 实现函数 makeClosures,调用之后满足如下条件:1、返回一个函数数组 result,长度与 arr 相同2、运行 result 中第 i 个函数,即 result[i](),结果与 fn(arr[i]) 相同 input: 已知函数 fn 执行需要 3 个参数。请实现函数 partia 阅读全文
posted @ 2018-06-30 20:16 zhanghui_ming 阅读(148) 评论(0) 推荐(0) 编辑
摘要:实现一个打点计时器,要求1、从 start 到 end(包含 start 和 end),每隔 100 毫秒 console.log 一个数字,每次数字增幅为 12、返回的对象中需要包含一个 cancel 方法,用于停止定时操作3、第一个数需要立即输出 * 使用setTimeout方法 * 使用set 阅读全文
posted @ 2018-06-30 18:35 zhanghui_ming 阅读(1115) 评论(0) 推荐(0) 编辑
摘要:题目描述 修改 js 代码中 parseInt 的调用方式,使之通过全部测试用例 示例1 输入 '12' 输出 12 示例2 输入 复制 '12px' 输出 复制 12 示例3 输入 '0x12' 输出 0 function parse2Int(num) { var type = typeof nu 阅读全文
posted @ 2018-06-30 18:05 zhanghui_ming 阅读(295) 评论(0) 推荐(0) 编辑
摘要:1. 移除数组 arr 中的所有值与 item 相等的元素,直接在给定的 arr 数组上进行操作,并将结果返回 input:[1, 2, 2, 3, 4, 2, 2], 2 output: [1, 3, 4] https://www.nowcoder.com/practice/a93dd26ebb8 阅读全文
posted @ 2018-06-29 10:19 zhanghui_ming 阅读(215) 评论(0) 推荐(0) 编辑
摘要:更新图片, 如果图片的url没有改变, 刷新页面之后图片会使用缓存的图片 Solutions: * js改变图片链接 (添加get参数) * html Meta修改 * js更新缓存 阅读全文
posted @ 2018-06-28 16:35 zhanghui_ming 阅读(4891) 评论(0) 推荐(1) 编辑
摘要:// localStorage util var db ={ set : function(key, obj){ localStorage.setItem(key, JSON.stringify(obj)); }, get : function(key){ return JSON.parse(localStorage.getItem(key)); }, each : fun... 阅读全文
posted @ 2018-06-26 15:52 zhanghui_ming 阅读(448) 评论(0) 推荐(0) 编辑
摘要:* Rectangle继承Shape * 给定一个构造函数 constructor,请完成 alterObjects 方法,将 constructor 的所有实例的 greeting 属性指向给定的 greeting 变量。 input: var C = function(name) {this.n 阅读全文
posted @ 2018-06-21 19:43 zhanghui_ming 阅读(181) 评论(0) 推荐(0) 编辑
摘要:* jQuery ajax FormData 上传文件 template 关键的3个选项: cache: false, processData: false, contentType: false, * demo: alert.js config.js 阅读全文
posted @ 2018-06-21 16:48 zhanghui_ming 阅读(1416) 评论(0) 推荐(0) 编辑
摘要:* Function.prototype.bind // test * Array.prototype.map 阅读全文
posted @ 2018-06-21 11:26 zhanghui_ming 阅读(143) 评论(0) 推荐(0) 编辑
摘要:// https://open.alipay.com/developmentAccess/developmentAccess.htm var $ = window.jQuery; (function() { if (!NodeList.prototype.forEach) { NodeList.prototype.forEach = functio... 阅读全文
posted @ 2018-06-19 15:47 zhanghui_ming 阅读(127) 评论(0) 推荐(0) 编辑
摘要:build.gradle 阅读全文
posted @ 2018-06-17 20:40 zhanghui_ming 阅读(1870) 评论(1) 推荐(0) 编辑
摘要:在安装好Maven之后,默认的~/.m2目录下是没有maven仓库配置文件settings.xml的,默认使用的是官方的仓库,访问速度会非常慢,我们需要配置下国内的仓库。 创建~/.m2/settings.xml文件,文件内容如下: 其中使用的是阿里云的mirror,国内的下载速度非常快。 阅读全文
posted @ 2018-06-12 10:12 zhanghui_ming 阅读(597) 评论(0) 推荐(0) 编辑
摘要:页面公共部分以javascript document.write()方式加载 生成的js放到需要的位置 footer.js 放到body底部引入 ... <script src="js/footer.js"></script> </body> php.exe所在文件夹添加到path环境变量, 在命令 阅读全文
posted @ 2018-06-11 18:01 zhanghui_ming 阅读(715) 评论(0) 推荐(0) 编辑
摘要:test: Thinkphp Model 阅读全文
posted @ 2018-06-11 17:57 zhanghui_ming 阅读(456) 评论(0) 推荐(0) 编辑
摘要:字符串反转 * 如果第二个参数 bUnicode255For1 true,则所有字符长度为 1否则如果字符 Unicode 编码 > 255 则长度为 2 input: 'hello world, 牛客', false output: 17 阅读全文
posted @ 2018-06-11 17:52 zhanghui_ming 阅读(271) 评论(0) 推荐(0) 编辑
摘要:1. getUrlParam.js 2. require.js 配置 3. 使用 * 获取 url 中的参数1. 指定参数名称,返回该参数的值 或者 空字符串2. 不指定参数名称,返回全部的参数对象 或者 {}3. 如果存在多个同名参数,则返回数组 input: http://www.nowcode 阅读全文
posted @ 2018-06-11 17:49 zhanghui_ming 阅读(876) 评论(2) 推荐(0) 编辑