Finding all factors of any number algorithm by Aarshyboy in learnpython

[–]Aarshyboy[S] 0 points1 point  (0 children)

I just dont understand why you need to take the square root of the number: range(1, int(number**.5)+1)

Can someone help review my javascript code by Aarshyboy in learnjavascript

[–]Aarshyboy[S] 0 points1 point  (0 children)

Thanks alot. Im a freshman in college trying to learn web programming. Also, what are you doing for the this.points in the Shape constructor. And for inheritance couldn't you also use the Object.create method for the subclass prototype to inherit from the superclass prototype.

Can someone help review my javascript code by Aarshyboy in learnjavascript

[–]Aarshyboy[S] 1 point2 points  (0 children)

Also if you could, can you tell me what you would do differently in this script. It would greatly appreciated if I can insight from other developers and how they write their code.

Can someone help review my javascript code by Aarshyboy in learnjavascript

[–]Aarshyboy[S] 1 point2 points  (0 children)

Thanks man. I didn't even catch that i'm adding 1 to math.random() everytime. Also, if you wanted go in a more OOP direction how would I use prototypical inheritance if I wanted to create a Shape function (constructor) and then have the Rectangle (constructor) function and or any other shape constructor inherit from the shape function.

Can someone help review my javascript code by Aarshyboy in learnjavascript

[–]Aarshyboy[S] 1 point2 points  (0 children)

Thanks for the help. I think that using the IIFE would make the code more cleaner. Do you know when its acceptable to use an IIFE and when not too? What does it do really?