JSRUN 用代码说话
Greet
grt322
第32785位JSRUN用户

活跃于 2020-10-15 05:53 访问量:3737
关注


Greet(grt322)

2020-08-14 12:40
蚂蚁金服前端面试题 题目 1: debounce 的简单实现


Greet(grt322)

2020-08-14 12:40
蚂蚁金服前端面试题 题目 2:实现一个 convert 函数, 接收一个10进制整数n,转化为7进制数(用字符串表示)。例如 7转化为'10',2019转化为'5613'。


Greet(grt322)

2020-08-14 12:38
蚂蚁金服前端面试题 /* 题目 3: 模版替换引擎函数,根据模版字符串和传入的数据返回替换后的字符串,形如(template, data) => string, 具备一定的扩展性 参数: template: 模版字符串,例如 "My name is ${ name }, I'm ${ age } years old." data: 数据对象,例如{ name: '小王', age: 20 } 返回: "My name is 小王, I'm 20 years old." */ function render(template, data) { let reg = /\$\{(.*?)\}/g; return template.repalce(reg, (match,key)=> data[key.trim()]) }


Greet(grt322)

2020-08-14 12:36
蚂蚁金服前端面试题 // 题目 4:实现一个基本的 event-emitter。 class EE { emit(name, ...params) { } // once 指只通知一次 once(name, func) { } on(name, func) { } off(name, func) { } }


Greet(grt322)

2020-08-14 12:34
蚂蚁金服前端面试题 题目 5:实现下面函数的功能 function slice(arr) { } const arr = slice([1, '2', 3, '4', 5, '6', 7, '8', 9, '0']); // 取得数组中 索引从 2 到 5 的元素,返回新的数组 arr['2:5']; // [3, '4', 5] 请注意使用的语法,不是小括号,而是中括号


Greet(grt322)

2020-08-13 16:56
求数组中两数之和 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。 你可以假设每种输入只会对应一个答案。但是,数组中同一个元素不能使用两遍。   示例: 给定 nums = [2, 7, 11, 15], target = 9 因为 nums[0] + nums[1] = 2 + 7 = 9 所以返回 [0, 1] 来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/two-sum 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。


没有了
1/2 下一页