13/13 I know you dont need a code but i want to practice


#1

so for 13 you obviously dont need a code for it but i want to get better at it. Im trying to use an array, for loop, funtions, and if else statements in my code. This is my code.

var codingNames = ["HTML","Jquery","javascript","python","PHP"];

for (var i=0; i < codingNames.length; i++){

var codingNames = function(){
if(codingNames<=10){
console.log("I am getting better at javascript!");
}else{
console.log("I need a little bit more practice");
}

}
};

What i am tring to do is if the names are less than 10 then it will print out i am getting better at javascript. can someone please help me?


#3

I noticed that you declared two variables called codingNames. You need to change the name of one of them to something else and then get the name of the function to print to the console by simply inserting the name at the end of the whole code. Don't know too much about for loops just yet but anyway I did this...

var codingNames = ["HTML","Jquery","javascript","python","PHP"];

for (var i=0; i < codingNames.length; i++){
codingNames[i];

var displayAnswer = function(){
if(codingNames.length <= 10){
console.log("I am getting better at javascript!");
}else{
console.log("I need a little bit more practice");
}
}
}

displayAnswer();