Ask your own question, for FREE!
Computer Science 13 Online
OpenStudy (anonymous):

Anyone that can help with Javascript, please? I can't figure out how to do my lab that deals with class instantiation and do loop for Fibonacci sequence? Medal will be awarded!

OpenStudy (e.mccormick):

This is for Java, not JavaScript, but it shows a solution: http://examples.javacodegeeks.com/java-basics/for-loop/calculate-fibonacci-series-with-for-loop/ If you can rewrite that in JavaScript, you should be good. I have very little JS experience, so I can't help you off the top of my head. @dumbsearch2 is int JS a ton more, but I have not seen him post here in a little while.

OpenStudy (rsmith6559):

Classes in JavaScript are handled in an unusual way. Basically, you declare the constructor as a function, and other methods as Prototype properties of the class. I refer to https://developer.mozilla.org/en/JavaScript frequently. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create deals with this specifically, look at the Shape part of the example, the rest is for inheritance.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!