Yesterday afternoon took part in the Ali front-end of the written test, the topic is random, but it seems that the more difficult to follow the topic. Small partners are advised to attend as early as possible.
Overall, the problem is not difficult, there is time can be done, a total of 11 questions, 6 single-choice, 3-way blank, two big questions bar. One hours less time, plus I originally wanted to hit the code directly above, and then found too slow, so changed to a sumlime.
Single topic has a question of what is the unordered list of elements, a nervous I unexpectedly chose the <ol> .... My heart is going to crumble when I'm done with the exams.
Finally, there is a big question did not write, a blank and a big question did not finish. Make it perfect in this article.
1. Find all nodes with a width and height greater than 40 in the page.
1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4 <MetaCharSet= "UTF-8">5 <title>Document</title>6 <style>7 . Odiv{width:50px;Height:50px;}8 input{width:100px;Height:50px;}9 </style>Ten </Head> One A <Body> - <inputtype= "text"name= "Otext"> - <spanname= "Ospan">Span</span> the <Divclass= "Odiv">Div</Div> - <imgsrc=""name= "Oimg"/> - <Scriptlanguage= "JavaScript"> - functionReSource () { + varret=[]; - varobj=document.getElementsByTagName ("*"); + for(varI= 0; I<obj.length; I++){ A if(Obj[i].offsetwidth> +&&Obj[i].offsetheight> +){ at Ret.push (obj[i].tagname); - - } - } - returnret; - } in Console.log (ReSource ()); - </Script> to + - </Body> the </HTML>
It's pretty simple, right, Leng didn't respond.
2. Remove the space between the words and leave a space between the words. such as ' AAAA bbbb CCCC ddd E F g ' converted to ' aaaa bbbb CCCC ddd E F g ', which examines the knowledge of regular expressions, has been avoiding the regular, and now seems to be the front end of the necessary skills
1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4 <MetaCharSet= "UTF-8">5 <title>Document</title>6 </Head>7 <Body>8 <Script>9 vars= 'AAAA bbbb CCCC ddd E F g';Ten varR= /\s+/G; One s=S.replace (R,' '); A Console.log (s); - </Script> - </Body> the </HTML>
2015 Ali front-end engineer online written test finishing