Jump to content
Killersites Community

Search the Community

Showing results for tags 'checkio'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Entrepreneurship, Business and Marketing
    • Course: Business Battle Plan
    • Social Media Marketing & Web Marketing
    • Entrepreneurship
  • Community Lounge and FAQ
    • Open Forum
    • New Members Forum - Start Here!
    • Forum Rules and Etiquette
    • Killersites Announcements
  • Web Design
    • Beginners Web Design
    • HTML/XHTML
    • CSS
    • Advanced Web Design
    • Business of Web Design
    • Web Design News
  • Software
    • StudioWeb
    • Dreamweaver
    • Photoshop
    • Miscellaneous Software
  • Programming
    • Python
    • Javascript
    • PHP
    • General Programming
    • Beginners Ruby
  • Miscellaneous
    • Cybersecurity
    • Blogs and CMS
    • Web Accessibility
    • Peer-to-Peer Reviews
    • Website Templates
    • Web Design Jobs
  • Archives
    • Beginners Web Design
    • Web Accessibility
    • CSS
    • Flash
    • ASP
    • Expression Web
    • Killersites University
    • Actionscript

Calendars

  • Community Calendar

Categories

  • Web Templates
  • PHP Script Bank
  • Javascript Script Bank
  • Web Design Documents and Contracts

Found 1 result

  1. Hey everybody, I'm a beginner at JavaScript so there are many things I don't understand. I'd appreciate very much if you can help me figuring out something new. I'm trying to solve this problem on Checkio.org called "The Most Numbers". The requirement is quite simple: It is given an array of floats and you have to calculate the difference between the maximum and minimum numbers. And this is my solution (which didn't work): function mostNumbers(numbers){ if (numbers.length > 0) { return Math.max(numbers) - Math.min(numbers); } else { return 0;} } It produced "0" regardless of what "numbers" is. I tried some stuff related to the Math.max() and Math.min() methods. And this is what I received: Math.max(1,2,3) // => 3 But when I assigned the array to a variable, this is what I received: var numbers = (1,2,3); Math.max(numbers) // => 3 (nothing wrong) Math.min(numbers) // => 3 (why?) I realized that it always take the last number, regardless what I want, so I tried typing (1,2,3) into the console and I got 3. Why is that? Then I realized that this is not a normal array, which has the structure [something, something else,...]. I reached out to w3school but what I received are just simple examples like Math.max(5, 10); // => 10 I reached out to stackoverflows as well and found this: With all the respect for this person (who is contributing value, that's great), I find the problem even more confusing. - What is a series of numbers, if not an array of numbers? - What is a spread operator? I clicked on the link he/she provided, but I didn't understand what I read: Thank you for reading my post, I know it's long. I appreciate it.
×