In Javascript Function (),

Source: Internet
Author: User

In Javascript Function (),
The following is a list of 18 JS functions. If you know what these functions are for, you can answer a few correctly. If you don't talk much about them, go directly to the method. 1, gao long has regrets (when Joe helped the Lord to make this move in the woods, he directly sucked the Two elders from the dog bat, how awesome the wind), the following function is to come and settle, if you want to come here, I will give you a try. If you want to come here, I will not say anything, but I will make a regret. The answer is already known: function whatDoesItDo (val) {return val? 1: 2;} 2, Fei Long in the sky (Guo Jing's silly brother learned this trick for three days to learn seven public education, as for the power of self Needless to say) guo jingren is dumb, but he can still get the indiscriminate function whatDoesItDo (param) {return {blue: "# 0000ff", green: "#00ff00", red: "# ff0000"} [param];} 3. Jian long zaitian (this was a trick Guo Jing made to save Rong ER) Although Guo Jing was able to get a clear picture, tolerance ronger, a friend of mine, can do everything for her sister. This is a red eye. See the following function to know that everything is a red function whatDoesItDo (color) {if (color! = 'Blue '| color! = 'Green') {color = 'red';} return color;} 4. Do not use Qianlong (although the development momentum is good, it is relatively weak, so be careful, can't be moved lightly) Guo Daxia makes this move and still pays attention everywhere. Just like finding your other half in this world, Guo Jing finds Rong er and I only find myself, what do you mean? I am a bachelor, and my brother is a king of five diamond. I don't even say anything. It's tears. What about my other half? Look at the code, the answer is above function whatDoesItDo (arr) {return arr. filter (function (elem, pos) {return arr. indexOf (elem) = pos;}) ;}; 5. He was shocked by Bai Li, 51 hexagrams in Yijing. It was also a trick for Guo Jing to deal with Ouyang Feng. Ouyang Feng was an old thief, after desperate efforts, I want to find some benefits for my son. However, some male do not want to be right. Unfortunately, they finally get angry. This is a very powerful trick in the 18 th palm, https: // deve After reading the cheats above, the answer below naturally shows function whatDoesItDo (arr) {return arr. reduce (function (s, n) {return s + n ;}, 0) ;}6, or jump in the yuan, the dragon sometimes will be at the bottom of the yuan, sometimes fly out, the real cool X people should be like Dragon, even with a Casio can have a meal like OMG, this is idle, this trick is not only in use by Guo Jing, we all have respect for this move in Chinese martial arts. king of Kongfu Bruce Lee is especially fond of this move. Remember that at the last Rome campus in the game of death, Tang Long was already under the storm, however, at this time, he made the move or jumped to the yuan, and turned his abilities into two or three times. There is no way to limit the infinite, the answer above, and look at the code function whatDoesItDo (arr) {return arr. map (function (x) {return x * 2;});} 7. Suddenly, Guo Jing heard the call from ronger, And the spirit was erratic, this is the 11 strokes of the Dragon's 18 th palm, which are suddenly reflected in the following code. As for the answer, the answer is not leaked. If you want to discuss it with me, function whatDoesItDo (mood) {return mood & "I like this" | "I don't like this";} 8. shuanglong water intake, Guo Jinggang climbed up the deck from the beginning of the ship, in a hurry, I was unable to rescue myself. I took the double-handed trigger and hit Ouyang Feng with a "Double Dragon water intake. These tricks beat Ouyang Feng and they are also shocked. How can they be reflected in our code? The common multi-thread tricks absorb the essence of this trick, it is a pity that js is single-threaded and cannot prevent it from playing its due role. It must be combined for a long time. This is the case since ancient times. See the following code: function whatDoesItDo (str) {return str. split (''). reverse (). join ('')}

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.