Image Image Image Image Image
Scroll to Top

To Top

JavaScript Archives - THEMWEBS

15

Jun
2018

No Comments

In JavaScript

By Manny

Async HTTP Requests

On 15, Jun 2018 | No Comments | In JavaScript | By Manny

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 make another post about this.

Async is short for Asynchronous. This means an operation that happens one at a time after the previous operation has completed.

XML HTTP Request

sources: 

http://shop.oreilly.com/product/0636920032151.do

https://github.com/toddmotto/public-apis

fizzbuzz – JavaScript

On 13, Jun 2018 | No Comments | In Computer Science, JavaScript | By Manny

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”

20

Apr
2018

No Comments

In JavaScript

By Manny

Reverse a string algorithm with JavaScript

On 20, Apr 2018 | No Comments | In JavaScript | By Manny

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 whatever you need.

reverse();
The reverse method changes the order of the element in the array in situ at call time. The zeroeth element will become the last element in the array and the last element the first in the array.

join(”);
The join method will recombine all the given items in the array and then return the array.

Tags |