
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%', } }