TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mohd Talib
NA
83
680
Write a function to generate a series of random numbers.
Jun 3 2019 3:37 AM
Generate some events
Write a function to generate a series of random numbers. The function should print a random number between 1 and 1000 every 1 second.
function generateTerms ()
{
// your code here that prints a random number every second
}
Implement a callback
Extend the generateTerms function in step 1 to call a supplied callback with the generated random number every second. Test the callback by making it do the printing task
function generateTerms (callback)
{
// your code here that calls the supplied callback with a random number every second
}
function callback(term)
{
// your code here that prints the term
}
generateTerms(callback)
Print a running count
Extend the callback to count and print a running count of the incoming terms
Print a running average
Extend the callback to compute and print a running average of the incoming terms
Print a running standard deviation
Extend the callback to compute and print a running standard deviation of the incoming terms.
Reply
Answers (
5
)
Serialization Assigning Value to Properties getting Error
How Populate Excel Worksheets name to dropdown