Help wanted for looping code skill test, Question 1,2&3. [Also, Hello : ) ]

The link to the skill test Link;

Github repo of the first test Link

Second test Link

Third test Link

Hello @Slogghy_kitten5

how can i help you with those test

what about you share your code on or or any other service you like and we dive into that and see what is not right

hope that help and have a nice day :slight_smile:

Thank you very much for replying :smile:
Here are the Codepen Links, they are not much but That’s the best I could do.

Test 1

Test 2

Test 3

you very welcome

for test one i see you just make some typo

 let arrLEn = myArray.length;  here you called the variable arrLEn
    for(i = 0; i > arrLen ; i++){     but here you asked for variable arrlen  remmber js is case sensitive  also you should use i< arrlen not i > arrlen since you start from first index to the last one

    let item = document.createElement('li');
    item.textContent = myArray[i];
    document.appendChild(item);  you should append the item to the ul list 
so it should be     list.appendChild(item);


this for test one hope it help :slight_smile:

1 Like

now for test 2

let nm =;                     you do not need that 
let num = phonebook.number               also you do not need that
you access the array by index and each property by .
    for(i=0;i>nm.length;i++){                      you use phonebook.length and same i<phonebook.length

    if(nm[i]=name){              you use phonebook[i].name and in compare use === 
as = is assignment == used to compare but ignore the type so if we have string a = "55" and  integer b = 55 then a==b will lead to true even they of different type but === compare and check is they of same type so in above example a===b would lead to false 
    para.textContent = num[i]        we use phonebook[i].name and you missed the semicolon at the end of the statement  
    break                                 also semicolon
    else{                you do not need to include else as there nothing to do and the loop will continue also 

hope that make it clear :slight_smile:

1 Like

now for test 3

you need to make a loop start from the i then decrease it by 1 each iteration
then in each cycle you check the number if it prime or not by calling the isPrime function if the return of the function is true then it’s prime then you append it to string variable
you keep doing that till you reach 1 then
after that you make the para.textContent = that string you created that has all the prime number

remmber to add space after each prime number you add to that string

hope it help and have a nice day :slight_smile:

1 Like

another thing you can use this online js ide

which help you find typo and other issue and also it better to use ide or text editor it will be installed on your device and help you alot
1 Like

Thank you very very much. :smiley: :smiley: :smiley: :grinning: :grin:

1 Like

you very very welcome :slight_smile:

1 Like