To clarify from last thread, this method works for determining primes that are less than 10. 11 is prime and would output as non-prime because it is not a product of 2, 3, 5, or 7.
The function will, however, determine an infinite number of non-prime numbers, so long as those numbers are a product of either 2, 3, 5, or 7, or some combination thereof.
The method is comically bad because it can only find 4 primes, and its ability to find non-prime numbers is not exhaustive.
will this work? i've always just used for loops for arrays.
James Hernandez
in a strongly typed language this abomination wouldn't even compile. Fuck JS
Caleb Lee
What's wrong with that?
Grayson Gonzalez
> t. web "developer"
Joseph Martin
If the value in the array is ever falsey, it will stop printing. If the values in the array are never falsey, it will keep printing out forever and go out of bounds until it finds something falsey.
Does anyone have the long greentext cap about the guy talking about how windows is a big cluster fuck of an operating system?
Carter Cooper
niggers
Hudson Brown
Wrong, you fucking brainlet. An out of bounds array value will be falsey, hence the loop ends as soon as it reaches the end of the array.
The real answer for what is wrong with this is the fact that the programmer reimplemented the for loop as a while loop. It's not even inherently bad, it's just not common as the for loop typically gives you more flexibility than a while loop.
Leo Johnson
>>An out of bounds array value will be falsey >arbitrary memory is always 0
Joshua Thompson
Differentfag here, but look at the syntax
>var >function
It's javascript which means that out-of-bounds access will be `undefined` which is falsy.
Adrian Reed
>For example, let’s say we have the string The Documentary (2005) and the regular expression . Stopped reading right there.
Jonathan Murphy
>le stack overflow may-may turns out regular expressions can parse irregular strings, go figure.
Isaac Torres
from the supposed Microsoft employee?
Jacob Kelly
explain, i'm an yoomer.
Caleb Lopez
fuck back off to tumblr and stop posting the same inane shite in threads all over the place
Elijah Mitchell
It's not a matter of whether it can or can't do something. It's just not intended to do these things. It's a language used for simple text parsing, things like detecting emails and filtering swear words. When you use it for anything more complicated it quickly starts becoming a giant mess (no comments, variable names, symbols everywhere). A lot of languages, libraries and tools that are commonly used and expanded can be used to do unexpected things and I got used to it after seeing a lot of examples like this. I'm far more impressed when someone can make a clean interface for his library or a code base that is both effective and readable. Anyways have another stack overflow may-may (good for you if you're using Jow Forums more often than stack overflow) youtu.be/uNjxe8ShM-8
Isaac Perez
>this needs an in-depth explanation >nu-Jow Forums
Why would you have to create a list of numbers and then compare each to the argument? Just use a for loop that tries 'num%(num-1) ==0' until num-1 == 2
>It's okay when k&r and apple do the exact same thing with cstrings
Jacob Nelson
>yesterday >"need to restart to install update" message pops up with no fuck off option >whatever, it'll be quick >5 hours later it's at 27%
Matthew Sullivan
oh my godddd im losing 25 whole ms when inputting something in my terminal emulator
Easton Davis
based konsole
Hunter Kelly
That's unironically how Sony did their ps3 crypto and why what should have been a fucking nightmare to hack was so easy. Go watch the CCC talk from failoverflow. It's worth it for a laugh
Cameron Thomas
See, this man has accepted a-sexuality into his heart.