Collatz (3n + 1) sequence in JavaScript

Collatz (3n + 1) sequence in JavaScript problem You wish to generate the Collatz sequence using JavaScript. In this post we will see how to accomplish that and print in the console of the web browser that is in the web developer tools of each popular web browser. Recall the Collatz sequence starts by giving […]

Simple AJAX example in JavaScript

Problem You have designed a web application with frontend and backend. The frontend page wishes to send an Asynchronous And JavaScript XML (AJAX) request to the backend and update a small portion of the page with the response that is text. The AJAX was introduced to make our websites look more like Desktop applications in […]

html add action on click of a button

html add action on click of a button Problem You are designing a webpage and wish to place a button that does something when you click it. This post we will use a simple HTML code that has a button and when you click it shows a hello popup. Solution A simple HTML page with […]

How to use a timer in JavaScript

How to use a timer in JavaScript Problem You are designing a web page and wish to add interactivity that will be occurring periodically. For example, it will be sending a request to an API every 10 seconds to retrieve information. For this post, we will use an example of updating a number incrementally every […]