In Challenge 6, you’ll learn to use loops and functions to solve a problem. The challenge involves writing code to make the monkey collect bananas in a specific order. To solve this challenge, you’ll need to use a combination of loops and functions to control the monkey’s movements.
javascript Copy Code Copied function moveToLocation ( x , y ) { moveRight ( x ) ; moveDown ( y ) ; } moveToLocation ( 3 , 4 ) ; code monkey skill challenge 6-10
In Challenge 10, you’ll have the opportunity to put all of your coding skills to the test. The challenge involves writing code to solve a complex problem, using a combination of loops, functions, conditional statements, arrays, and indexing. In Challenge 6, you’ll learn to use loops
javascript Copy Code Copied var bananaLocations = [ 1 , 3 , 5 , 7 , 9 ] ; for ( var i = 0 ; i < bananaLocations . length ; i ++ ) { moveTo ( bananaLocations [ i ] ) ; eatBanana ( ) ; } javascript Copy Code Copied function moveToLocation ( x