前端技术-2016年阿里前端开发工程师笔试题
var arr = [1, 2, 3, 4, 5]; var result = arr.sort(_______________________________).join("+"); console.log(result);
7、把一个字面量对象,变成某个类的实例
function Type() {} var a = {}; ______________ // a instanceof Type === true
8、补充下面的函数,判断p为Array
function isArray(p){ return Object.prototype._____.apply(p)==='_____'; }
9、请写一个表格以及对应的CSS,使表格奇数行为白色背景,偶数行为灰色背景,鼠标移上去时为黄色背景。
10、实现一个程序,输入为一段英文文本,示例如下:
Alibaba Group Holding Limited is a Chinese e-commerce company that provides consumer-to-consumer, business-to-consumer and business-to-business sales services via web portals. It also provides electronic payment services, a shopping search engine and data-centric cloud computing services. The group began in 1999 when Jack Ma founded the website Alibaba.com, a business-to-business portal to connect Chinese manufacturers with overseas buyers. In 2012, two of Alibaba’s portals handled 1.1 trillion yuan ($170 billion) in sales.
统计这段文本中单词的出现频率、分布区间,要求如下:
1. 仅统计英文单词,1999 $170 1.1 标点符号之类的不算做单词
2. 区间分 4个:少(出现1-5次)、 中(出现6-10次)、高(出现 11-20),极高(出现 >20 次) ,给出每个区间单词数目在总单词数中的百分比
3. 返回如下的 JSON 对象:
{ 'occurrence': [/** 数据元素的第一个元素为单词,第二个位出现次数**/ ['alibaba', 10] ['consumer', 10] ['business', 8] ], 'distribution': { 'high': '30%', 'low': '20%', 'medium': '40%', 'veryHeigh': '10%', } }