as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
write an algorithm for printing out all fibonacci numbers up to 100.
user
//fibonacci sequence algorithm 
 
//set up two variables to track the current and last number
var current = 0; 
var last = 1; 

//loop from 0 to 100
for (var i = 0; i < 100; i++) { 
 
  //calculate the next fibonacci number as the sum of the two variables 
  var temp = current + last; 
 
  //print out the current number 
  console.log(current); 
 
  //rebind the last number to the current number 
  last = current;  
  
  //rebind the current number to the value stored in the temp variable 
  current = temp; 
}
assistant