MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/CodingHelp/comments/oc1b7p/problem_with_javascript_code/h3rgk61/?context=3
r/CodingHelp • u/Cheesybread4ever • Jul 02 '21
19 comments sorted by
View all comments
3
Looks like trouble with the logic of it to me. Why don't you try instead "if ... -> return true", take the else away and change the "return true" at the end for "return false" and then take it from there?
1 u/Cheesybread4ever Jul 02 '21 But I don’t want it to return true until it’s check every element of myArray. If I put return true inside the if statement it will always return true. 1 u/NoAd7524 Jul 02 '21 For uniqueness it seems like you need to check each number against the rest. Double loops, perhaps? Let's wait for the text code.
1
But I don’t want it to return true until it’s check every element of myArray. If I put return true inside the if statement it will always return true.
1 u/NoAd7524 Jul 02 '21 For uniqueness it seems like you need to check each number against the rest. Double loops, perhaps? Let's wait for the text code.
For uniqueness it seems like you need to check each number against the rest. Double loops, perhaps? Let's wait for the text code.
3
u/NoAd7524 Jul 02 '21
Looks like trouble with the logic of it to me. Why don't you try instead "if ... -> return true", take the else away and change the "return true" at the end for "return false" and then take it from there?