JavaScript

Async HTTP Requests

Working with the web you will have to at some point get some data from some where. You might like to call an API. Here is an example of a classic XML HTTP request. There are more modern ways of retrieving data, like using fetch() api, thats cool… I will Read more…

By Manny, ago
Computer Science

fizzbuzz – JavaScript

Fizzbuzz Programme, is a program that prints the numbers from 1 to 100. For the multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”

By Manny, ago
JavaScript

Reverse a string algorithm with JavaScript

Ever wondered how many different ways you can write a reverse string algorithm in JavaScript? You can use a combination of helper methods built into JavaScript: split(”); The split method separates the string into substrings, which are separated by a given separator. The separator can be a blank space, comma or Read more…

By Manny, ago
JavaScript

JavaScript map array helper method

Map is used when you want to modify data in some list or array and return a new modified array from that original array. I’m really enjoying cryptocurrency and all the fanfare that comes with it, so let’s use an array of crypto prices in our code example. Let’s: iterate Read more…

By Manny, ago
JavaScript

What is a forEach method

The forEach method is a special kind helper method available to us on an array.  It helps us loop/iterate over an array. It is an alternative method to iterating over an array using a for loop. for loop forEach When we call the forEach method we pass it an anonymous Read more…

By Manny, ago
JavaScript

What is “ use strict; ” in JavaScript, and what does it do?

If you have working with JavaScript over the last few years you will have no doubt come across this little snippet [sourcecode language="javascript" wraplines="true" highlight=""] "use strict"; [/sourcecode] Strict Mode is a new feature in ECMAScript 5 that allows you to place a program, or a function, in a "strict" operating context. This strict context prevents certain actions from being taken and throws more exceptions. (more…)

By Manny, ago