奇怪的面试题

在V2EX上看到这倒面试题。 You must solve this puzzle to apply There're 7 red tiles, 8 blue titles and one white title in a 4 x 4 plane. We could only move the white tile. When moving it, the white tile swaps the position with the adjacent tile. L, R, U, D are ... read more

js神奇的上下取整

~~3.1415926// 3 -~3.1415926// 4 今天在https://github.com/darcyclarke/Front-end-Developer-Interview-Questions/tree/master/Chinese 第一次看到,山炮了! ... read more

原生js技巧

1、原生JavaScript实现字符串长度截取 function cutstr(str, len) { var temp; var icount = 0; var patrn = /[^\x00-\xff]/; var strre = ""; for (var i = 0; i < str.length; i++) { if (icount < len - 1) { temp = str.substr(i, 1); if (patrn.exec(temp) == null) { icount = icount + 1 } else { icount = icount + 2 } strre ... read more