Skip to main content

🚀 In our NEW AI Bootcamp you'll build a working app in 28 days, no experience required. Free to all subscription levels.

Join the Treehouse affiliate program and earn 25% recurring commission! 🤑

✨ Earn college credits in Cybersecurity, JS, HTML, CSS and Python

  • Treehouse Logo
    • For Individuals
    • For Businesses
    • For Schools
    • For Libraries
    • For Military
    • All Courses
    • Tracks
    • AI Bootcamp
    • College Credit
    • Techdegree Bootcamps
    • Front End Development
    • Full Stack JavaScript
    • Code Adventures
    • Discord
    • Forum
    • Success Stories
    • Treehouse Links
    • 100 Days of Code
    • Explore
    • Career Toolbox
    • Free Treehouse Near Me
    • Affiliates
    • Blog
    • Support
    • About
    • Learn
    • Beginner's Guide to Coding
    • Data Analysis with SQL & Python
    • Front-End Web Development
    • Python Programming Basics
    • Techdegree Bootcamp Overview
    • UX Design Fundamentals
    • AI Tools for Beginners
  • For Individuals For Businesses For Schools For Libraries For Military
  • All Courses Tracks AI Bootcamp College Credit
  • Techdegree Bootcamps Front End Web Development Full Stack JavaScript
  • Code Adventures Discord Forum Success Stories Treehouse Links 100 Days of Code
  • Explore Career Toolbox Free Treehouse Near Me Affiliates Blog Support About
    Learn Beginner's Guide to Coding Data Analysis with SQL & Python Front-End Web Development Python Programming Basics Techdegree Bootcamp Overview UX Design Fundamentals AI Tools for Beginners
  • Sign In
  • Free Trial
Instagram Twitter Facebook YouTube LinkedIn
Loading banner... Start your free trial at Treehouse
    • Newest
      • Newest
      • Active
      • Unanswered
      • Featured
    • All Topics
      • All Topics
      • • General Discussion
      • • AI
      • • APIs
      • • Coding for Kids
      • • College Credit
      • • Computer Science
      • • CSS
      • • Data Analysis
      • • Databases
      • • Design
      • • Development Tools
      • • Digital Literacy
      • • Game Development
      • • Go Language
      • • HTML
      • • Java
      • • JavaScript
      • • Learning Resources
      • • Machine Learning
      • • No-Code
      • • PHP
      • • Professional Growth
      • • Python
      • • Quality Assurance
      • • React
      • • Ruby
      • • Security
      • • Swift
      • • Vibe Coding
  • Fuad Ak
    PLUS
    Fuad Ak
    Courses Plus Student 691 Points

    array sorting

    Posted February 4, 2015 1:55pm by Fuad Ak
    Fuad Ak
    Courses Plus Student 691 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    1 Answer

  • MUZ140122 Emmanuel Kavhuru
    MUZ140122 Emmanuel Kavhuru
    5,605 Points

    I don't understand how to create a code that sorts elements by length function.

    Posted February 3, 2015 6:49am by MUZ140122 Emmanuel Kavhuru
    MUZ140122 Emmanuel Kavhuru
    5,605 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    2 Answers

  • Jeff Xu
    Jeff Xu
    10,291 Points

    Javascript's Array.sort() question

    Posted January 23, 2015 7:43am by Jeff Xu
    Jeff Xu
    10,291 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    1 Answer

  • Joe Williams
    Joe Williams
    4,014 Points

    I don't understand why creating a function that subtracts a-b then sorts the numbers in the array.

    Posted December 2, 2014 3:52am by Joe Williams
    Joe Williams
    4,014 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    3 Answers

  • rafael perez
    rafael perez
    4,269 Points

    why we keep using the toString function?

    Posted November 14, 2014 5:11pm by rafael perez
    rafael perez
    4,269 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    1 Answer

  • hakan Gülay
    hakan Gülay
    8,489 Points

    I couldnt understand how it orders

    Posted September 11, 2014 4:52am by hakan Gülay
    hakan Gülay
    8,489 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    3 Answers

  • Wajeeh Hassan Qureshi
    Wajeeh Hassan Qureshi
    8,631 Points

    Comparitive function

    Posted August 16, 2014 7:41am by Wajeeh Hassan Qureshi
    Wajeeh Hassan Qureshi
    8,631 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    2 Answers

  • Martin Argosino
    Martin Argosino
    1,447 Points

    In JavaScript Foundations, I'm stuck on Arrays/Methods-2, Challenge Question 2. Is there somewhere I can get the answer?

    Posted August 12, 2014 10:40pm by Martin Argosino
    Martin Argosino
    1,447 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    3 Answers

  • alexeiklika
    PLUS
    alexeiklika
    Courses Plus Student 2,589 Points

    How do arguments automatically get passed to a function when not manually assigned?

    Posted August 7, 2014 3:21pm by alexeiklika
    alexeiklika
    Courses Plus Student 2,589 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    2 Answers

  • Jerry Liu
    PLUS
    Jerry Liu
    Courses Plus Student 1,233 Points

    How does the sort compare function work?

    Posted July 3, 2014 10:44am by Jerry Liu
    Jerry Liu
    Courses Plus Student 1,233 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    2 Answers

  • Presley Cobb
    Presley Cobb
    9,214 Points

    Methods Part 2

    Posted June 14, 2014 11:37pm by Presley Cobb
    Presley Cobb
    9,214 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    2 Answers

  • orange sky
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    orange sky
    Front End Web Development Techdegree Student 4,945 Points

    return Math.random()-0.5;

    Posted June 6, 2014 9:39am by orange sky
    .a{fill-rule:evenodd;}techdegree
    orange sky
    Front End Web Development Techdegree Student 4,945 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    3 Answers

  • orange sky
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    orange sky
    Front End Web Development Techdegree Student 4,945 Points

    sorting numbers Ascending, Descending, and equal????

    Posted June 6, 2014 8:56am by orange sky
    .a{fill-rule:evenodd;}techdegree
    orange sky
    Front End Web Development Techdegree Student 4,945 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    3 Answers

  • orange sky
    seal-mask
    .a{fill-rule:evenodd;}techdegree
    orange sky
    Front End Web Development Techdegree Student 4,945 Points

    sort()

    Posted June 6, 2014 8:23am by orange sky
    .a{fill-rule:evenodd;}techdegree
    orange sky
    Front End Web Development Techdegree Student 4,945 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    7 Answers

  • Andrew Barbier
    Andrew Barbier
    1,980 Points

    Confused

    Posted May 29, 2014 5:00am by Andrew Barbier
    Andrew Barbier
    1,980 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    1 Answer

  • Ireneusz Kopta
    Ireneusz Kopta
    6,212 Points

    Problem

    Posted April 27, 2014 8:19pm by Ireneusz Kopta
    Ireneusz Kopta
    6,212 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    4 Answers

  • Ireneusz Kopta
    Ireneusz Kopta
    6,212 Points

    Problem

    Posted April 27, 2014 8:19pm by Ireneusz Kopta
    Ireneusz Kopta
    6,212 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    3 Answers

  • geoffrey
    geoffrey
    28,736 Points

    sort() method and its function to sort numerically

    Posted March 14, 2014 2:39pm by geoffrey
    geoffrey
    28,736 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    2 Answers

  • Paul Son
    Paul Son
    5,474 Points

    Methods and functions

    Posted February 16, 2014 8:30am by Paul Son
    Paul Son
    5,474 Points
    • JavaScript
    • JavaScript Foundations
    • Arrays
    • Methods: Part 2

    2 Answers

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

Techdegree

  • Front End Web Development
  • Full Stack JavaScript
SEE ALL

Tracks

  • Learn to Code for Beginners
  • Beginning Python
  • Beginning SQL
  • Beginning Java
SEE ALL

Courses

  • JavaScript Basics
  • Intro to HTML & CSS
  • Python Basics
  • CSS Layout
SEE ALL

About Us

  • About
  • Blog
  • Community
  • Stories
  • Contact
  • Gift Card

Explore

  • Plans
  • Affiliates
  • Perks
  • Shop
  • Free Treehouse Near Me
  • Treehouse for Libraries
  • Treehouse for Businesses

Treehouse is an online technology education platform founded in 2011. Treehouse offers more than 700 self-paced, video-based courses in web development, programming, data analysis, design, and AI, plus two project-based bootcamp programs in Front End Web Development and Full Stack JavaScript. Individual Treehouse plans start at $25 per month and include a 7-day free trial. Treehouse serves individual learners, businesses, schools, and public libraries. Cardholders at participating U.S. public libraries can use Treehouse for free. Select Treehouse courses, offered with University Pathways International, are recommended for college credit by ACE and NCCRS. Treehouse learners earn digital certificates for completed Tracks.

Terms & Conditions · Privacy · © 2026 Treehouse Island, Inc.
  • Twitter
  • YouTube
  • Facebook
  • LinkedIn
  • Instagram
  • Discord