摘要: js leetcode : two sum Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that ea 阅读全文
posted @ 2017-11-09 20:36 芒果夏夏 阅读(110) 评论(0) 推荐(0) 编辑
摘要: javascript function fn(arr) { return arr.reduce(function(prev,next){return prev 阅读全文
posted @ 2017-09-28 23:16 芒果夏夏 阅读(848) 评论(0) 推荐(0) 编辑
摘要: Given an n x n array, return the array elements arranged from outermost elements to the middle element, traveling clockwise. my answer forEach() 方法用于调 阅读全文
posted @ 2017-09-19 14:32 芒果夏夏 阅读(302) 评论(0) 推荐(0) 编辑
摘要: ```javascript console.log(noRepeat([ 2, 1, 3, 4, 1, 2, 1, 5, 4])); //[4, 2, 1, 1, 2, 3, 5] console.log(noRepeat([ 14, 10, 13, 4, 21, 2, 1, 5, 4])); // 阅读全文
posted @ 2017-09-18 23:05 芒果夏夏 阅读(286) 评论(0) 推荐(0) 编辑
摘要: Eaxmple my answer javascript function minSecond(n) { var second_ = Math.floor(n%60); if (second_ 阅读全文
posted @ 2017-09-17 22:28 芒果夏夏 阅读(351) 评论(0) 推荐(1) 编辑
摘要: var a = document.getElementById("a"); 想获得left值 当css样式是内联的时候,JavaScript可以获得 a.style.left、a.offsetLeft 当css样式是外联的时候,JavaScript无法获得 a.style.left,只能获得 a.o 阅读全文
posted @ 2017-09-16 23:55 芒果夏夏 阅读(355) 评论(0) 推荐(0) 编辑
摘要: my answer 阅读全文
posted @ 2017-09-14 23:49 芒果夏夏 阅读(128) 评论(0) 推荐(0) 编辑
摘要: bootstrap的轮播图代码直接用不修改的话, 容易出现以下情况: 很多人的解决办法就是把图片宽度设置为100%,但如果仅仅只是将图片设置为100%,则容易出现如下情况,整个轮播图填充了大部分页面,有时候这并不是我们想要的效果 解决办法就是先让为整个轮播块添加居中属性:class=‘contain 阅读全文
posted @ 2017-09-13 09:23 芒果夏夏 阅读(2993) 评论(0) 推荐(1) 编辑
摘要: You are NOT allowed to use any temporary arrays or objects. You are also not allowed to use any or methods. my answer JavaScript function removeZeros( 阅读全文
posted @ 2017-09-12 20:08 芒果夏夏 阅读(359) 评论(0) 推荐(0) 编辑
摘要: Description: Write an algorithm that takes an array and moves all of the zeros to the end, preserving the order of the other elements. my answer: java 阅读全文
posted @ 2017-09-11 17:36 芒果夏夏 阅读(113) 评论(0) 推荐(0) 编辑