<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ### 2018年第二期前三周復習 1. 寫出你所熟知的ES6新語法,說出它們和ES5的區別! 2. 請說出你對 “重排和重繪讀寫分離” 的理解! 3. 寫出下面代碼運行的結果 ~~~javascript 1.var str='abc123', 2. num=parseFloat(str); 3.if(num===NaN){ 4. alert(NaN); 5.}else if(num===123){ 6. alert(123); 7.}else if(typeof num==='number'){ 8. alert('number'); 9.}else{ 10. alert('str'); 11.} ~~~ 4. 寫出代碼執行的結果 ~~~javascript 1.var a='abc'+123+456; 2.alert(a); 3. 4.var b='456'-'123'; 5.alert(b); 6. 7.var c=1, 8. d='1'; 9.var f=c>d?(c<d?c:d):(c==d?c:d); 10.alert(f); ~~~ 5. 用戶昵稱規定只能是“數字、大小寫字母”組成,而且不能少于2位,也不能超過20位,寫個正則匹配這個需求 6. 談談你對面向對象的理解! 7. 寫出代碼運行結果 ~~~javascript 1.var point={ 2. x:10, 3. y:20, 4. moveTo:function(x,y){ 5. var moveX=function(x){ this.x=x; } 6. var moveY=function(y){ this.y=y; } 7. moveX(x); 8. moveY(y); 9. } 10.}; 11.point.moveTo(100,200); 12.console.log(point.x,point.y); ~~~ 8. 分析代碼寫結果 ~~~javascript 1.function fun(){ 2. this.a=10; 3. this.b=function(){ 4. alert(this.a); 5. } 6.} 7.fun.prototype={ 8. b:function(){ 9. this.a=20; 10. alert(this.a); 11. }, 12. c:function(){ 13. this.a=30; 14. alert(this.a) 15. } 16.} 17.var my_fun=new fun(); 18.my_fun.b(); 19.my_fun.c(); ~~~ 9. 分析代碼寫結果 ~~~javascript 1.var n=2; 2.function a(){ 3. var n=3; 4. function b(m){ 5. alert(++n+m); 6. } 7. b(4); 8. return b; 9.} 10.var c=a(5); 11.c(6); 12.alert(n); ~~~ 10. 談一下你對作用域鏈和原型鏈的理解 11. 實現 一個$attr(domId,name,value)遍歷id是domId的,內部屬性為name且值為value的元素? 12. 實現數組去重你都有哪些辦法? 13. 說出你所掌握的算法 14. 寫出你掌握的JS繼承方式,項目中什么時候你用到了繼承? 15. JS中有一個insertBefore方法,目的是實現把新元素插入到指定元素之前,現在你實現一個 InsertAfter 方法,把新元素插入到指定元素之后! ~~~javascript 1.function insertAfter(newEle,originEle){ 2. //=>newEle:新插入的元素 3. //=>originEle:指定的老元素 4.} ~~~ 16. 英文字母漢字組成的字符串,用正則給英文單詞前后加空格 17. jQuery的原理,怎么擴展插件 18. 看代碼,回答問題 ~~~javascript 1.for(var i = 0;i<5;i++){ 2. setTimeout(function(){ 3. console.log(i) 4. },1000); 5.} 6.這段代碼輸出什么?怎么才能輸出01234? ~~~ 19. 分析代碼寫結果 ~~~javascript 1.var a = {n:4}; 2.var b = a; 3.b.x = a = {n: 10}; 4.console.log(a.x); 5.console.log(b.x); ~~~ 20. 你了解過閉包嗎? ~~~javascript 1.var fullName='language'; 2.var obj={ 3. fullName:'javascript', 4. prop:{ 5. getFullName:function(){ 6. return this.fullName; 7. } 8. } 9.}; 10.console.log(obj.prop.getFullName()); 11.var test=obj.prop.getFullName; 12.console.log(test()); ~~~ ~~~javascript 1.let a = 3, 2. b = 4; 3.function A(a) { 4. A = function (b) { 5. alert(a + (--b)); 6. }; 7. alert(++a); 8.} 9.A(5); 10.A(6); ~~~ 23. ~~~javascript 1.window.val = 1; 2.let json = { 3. val: 10, 4. dbl: function () { 5. this.val *= 2; 6. } 7.}; 8.json.dbl(); 9.let dbl = json.dbl; 10.dbl(); 11.json.dbl.call(window); 12.alert(window.val + json.val); ~~~ 24. ~~~javascript 1.(function () { 2. let val = 1; 3. let json = { 4. val: 10, 5. dbl: function () { 6. val *= 2; 7. } 8. }; 9. json.dbl(); 10. alert(json.val + val); 11.})(); ~~~ 25. ~~~javascript 1.let test = (function (i) { 2. return function () { 3. alert(i *= 2); 4. } 5.})(2); 6.test(5); ~~~ 26. ~~~javascript 1.let n = 2, 2. fn = () => { 3. this.n *= 3; 4. n++; 5. return m=>console.log((++n)+m); 6. }; 7.var f = fn(4); 8.f(5); 9.fn(4)(5); 10.f(6); 11.console.log(n); ~~~ 27. 忽略報錯阻礙代碼的執行 ~~~javascript 1.let Fn = function (x = 0, y = 0) { 2. this.x = x; 3. this.y = y; 4. this.getX = function () { 5. console.log(this.x); 6. } 7.}; 8.Fn.prototype.getX = function () { 9. console.log(this.x); 10.}; 11.let f1 = new Fn; 12.Fn.prototype = { 13. getY: function () { 14. console.log(this.y); 15. } 16.}; 17.let f2 = new Fn(1, 2); 18.console.log(f1.constructor===f2.constructor); 19.f1.getX(); 20.f1.getY(); 21.f1.__proto__.getX(); 22.f1.__proto__.getY(); 23.f2.getX(); 24.f2.getY(); 25.f2.__proto__.getX(); 26.f2.__proto__.getY(); ~~~ 28. 寫出輸出結果,說出原因 ~~~javascript 1.let fn1=function(){alert(1)}, 2. fn2=function(){alert(2)}; 3.fn1.call(fn2); 4.fn1.call.call(fn2); ~~~ 29. 如下一個字符串 “54389”,要求將字符串中的阿拉伯數字替換成我們的中文大寫數字”伍肆叁捌玖”,請使用正則的方式進行處理 30. 在javascript對象上定義一個repeatify函數,這個函數接受一個整數參數,來明確子字符串需要重復幾次,這個函數要求字符串重復指定的次數,比如:’abc’.repeatify(3);//”abcabcabc” 31. `var str='hello<img src="haha.png" alt="哈哈"/>world';`正確匹配輸出’hello\[哈哈\]world’ 32. 一個url 后面好多key-value 如localhost?key=val&key2=val2&key3=val3 封裝一個函數 getParam(‘key’) 通過key獲得相應等號后面的值. 33. call、apply、bind的區別 34. 有兩個升序數組,然后將他們合為 一個數組并進行升序排序? 35. 瀑布流的實現原理 36. 圖片延遲加載怎么實現 37. 寫出完整的驗證函數 > 1)長度不能小于6位 > 2)首字母必須是字母 > 3)合法字符只能是數字、字母、下劃線 38. 使用jquery實現點擊按鈕彈出一個對話框(對話框在整個頁面正中間,并且最初頁面中沒有任何的HTML標簽)? 39. 怎么避免全局變量的污染? ~~~javascript 1.function Foo() { 2. getName = function () { 3. console.log(1); 4. }; 5. return this; 6.} 7.Foo.getName = function () { 8. console.log(2); 9.}; 10.Foo.prototype.getName = function () { 11. console.log(3); 12.}; 13.var getName = function () { 14. console.log(4); 15.}; 16.function getName() { 17. console.log(5); 18.} 19.Foo.getName(); 20.getName(); 21.Foo().getName(); 22.getName(); 23.new Foo.getName(); 24.new Foo().getName(); 25.new new Foo().getName(); ~~~ 41. ~~~javascript 1.在函數式編程當中有一個很重要的概念就是函數組合,實際上就是把處理數據的函數像管道一樣連接起來,然后讓數據穿過管道得到最終的結果。例如: 2.const add1 = (x) => x + 1; 3.const mul3 = (x) => x * 3; 4.const div2 = (x) => x / 2; 5.div2(mul3(add1(add1(0)))) //=>3 6. 7.而這樣的寫法可讀性明顯太差了。我們可以構建一個 compose 函數,它接受任意多個函數作為參數(這些函數都只接受一個參數),然后 compose 返回的也是一個函數,達到以下的效果: 8.const operate = compose(div2, mul3, add1, add1) 9.operate(0) //=>相當于div2(mul3(add1(add1(0)))) 10.operate(2) //=>相當于div2(mul3(add1(add1(2)))) 11. 12.簡而言之:compose 可以把類似于 f(g(h(x))) 這種寫法簡化成 compose(f, g, h)(x)。請你完成 compose 函數的編寫。 13.額外挑戰:你能通過 1~2 行代碼實現 compose 嗎。 ~~~ 42. 點擊每一個li可以創建出對應的對象(可以不兼容低版本瀏覽器) ~~~javascript 1.[結構] 2.<ul> 3. <li><a href='http://xxx'>xxx</a></li> 4. <li><a href='http://sss'>sss</a></li> 5.</ul> 6. 7.點擊第一個LI創建對象: 8.{ 9. index:1, 10. name:'xxx', 11. link:'http://xxx' 12.} 13.同樣點擊第二個LI創建對象 14.{ 15. index:2, 16. name:'sss, 17. link:'http://sss' 18.} 19.... ~~~ 43. 分析此函數的作用,補全1/2處的代碼 ![](https://img.kancloud.cn/87/07/8707faa7d427e25fe9c985bb9f083f40_616x551.png) 44. 獲取數據中的最大值 45. 編寫一個函數,把一個列表中的每一項反序 ~~~ 1.<ul id='target'> 2. <li>1</li> 3. <li>2</li> 4. <li>3</li> 5. <li>4</li> 6. <li>5</li> 7.</ul> ~~~ 46. 編寫一個函數實現數組扁平化 ~~~javascript 1.let ary = [1,[2,[3,[4,5]]],6]; //=>[1,2,3,4,5,6] ~~~ 47. 網頁中實現一個計算,計算當年還剩多少時間的倒數計時程序,要求網頁上顯示 “xxxx年還剩xx天xx時xx分xx秒”;(獲取當前時間采用new Data()即可) 48. offsetHeight/clientHeight/scrollHeight的區別 49. 獲取字符串中出現次數最多的字符及出現的次數 50. 完成如圖所示的文字橫向無縫銜接滾動的“跑馬燈”效果
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看