The Dragon 18 Palm in Javascript Function ()

Source: Internet
Author: User

Original address: http://tutorialzine.com/2014/08/what-does-this-function-do/

The following list of 18 JS function, see you know what these functions are used, you can answer a few, nonsense not much to say, directly on the method,

1, Prince have regrets (that amid in the woods, the master in the forest to take this trick, directly to the two elder's hit dog sticks suck away, how awe-struck), the following this function is improvise clear, you want to really I give you a foot, you want to fake, I apart, direct use Prince have regrets, the answer has been seen

Function Whatdoesitdo (val) {return val? 1:2;} 2, flying Dragon in the sky (that year Guo Jing silly brother learned three days to learn seven public teaching this trick, as far as the power from needless to say) Guo Jing people silly point can still be divided to clear misbehaviorfunction Whatdoesitdo (param) {return {blue: "#0000ff", Green: "#00ff00", Red: "#ff0000"}[param];} 3, See Dragon in the field (this trick is Guo Jing to save Rong son resorted to a recruit) Guo Jing Although is able to divide clear, misbehavior, can resist Rong son this confidant, for sister, anything can dry, this is red eyes, see the following function is known, what is redfunction Whatdoesitdo (color) {if (Color!== ' Blue ' | | | color!== ' green ') {color = ' red ';} return color;} 4, do not use the dragon (although the development momentum is better, but relatively weak, so should be cautious, not light movement) learned use this trick is still everywhere to pay attention, like in this world looking for your other half, Guo Jing found Rong son, I only found myself, what do you mean, I am a bachelor, Again high-end point is elder brother is a king old five diamonds, nothing said, are tears, my other half, look at the code, the answer is on topfunction Whatdoesitdo (arr) {return arr.filter (function (Elem, POS) {return arr.indexof (elem) = = pos;});}; 5, shocked thyme, the I Ching in the 51-Gua, is also Guo Jing to deal with Ouyang Fung, Ouyang Fung This old thief, spell life also want to for their son, but crooked people do not want the right path, unfortunately the last to go astray, this trick is 18 palm in the power of a big move, have all the meaning https:// Developer.mozilla.org/zh-cn/docs/web/javascript/reference/global_objects/array/reduce_clone directly on the code, read the above cheats, The following answers are naturally known.function Whatdoesitdo (arr) {return arr.reduce (function (s, N) {return s + N;}, 0);} 6, or leap in the deep, the dragon sometimes in the deep, sometimes fly out, the real cow x should be like Dragon, even with a Casio can be like the OMG have rice, this is gossip light, this trick not only Guo Jing in use, we Chinese martial arts we all have no respect for this recruit, king of Kongfu Bruce Lee is particularly fond of this trick, remember the death game in the last Roman Xiao Chang, to the scene, Tourneau is already in the wind, but at this time he resorted to this trick or leap in the yuan, falsehoods, thorough virtual virtual, will own capacity into twice times, 3 times times, is so-called to have the law to unlimited for limited, The answer is easy, and look at the codefunction Whatdoesitdo (arr) {return Arr.map (function (x) {return x*2;});} 7, Suddenly , Guo Jing listen to Rong son call, the spirit of vibration, the left hand clap, this is the 18 palm of the 11 strokes, the strokes of the sudden from the following code is visible, as for the answer, the secret can not be disclosed, want to discuss to find me,function Whatdoesitdo (mood) {return mood && "I like this" | | "I don ' t like this"; }8, Ssangyong Take water, Guo Jinggang from the bow to climb the deck, seeing potential urgency, has not been robbed to save, double Palm Qi FA, a recruit "Ssangyong water", hit Ouyang Fung midfielder. This trick dozen Ouyang Fung Gall Heart also surprised, this in our code, how to embody, common multithreading but absorbed the essence of this recruit, only unfortunately JS is single-threaded can not prevent its play due to the effect, a long time will be combined, a long time will be divided, since ancient times have this reason, and see the following code:function Whatdoesitdo (str) {return str.split ("). Reverse (). Join (')} So far today, to see how the funeral and look at tell .... I am rhino, reproduced in the source

The Dragon 18 Palm in Javascript Function ()

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.