Bucket Sort Algorithm In Javascript

Bucket (bin) sort is a sorting algorithm that parts an array into buckets. Each of these are sorted recursively with the bucket sorting algorithm. The basic procedure of Bucket Sort is: 1. Create an empty array 2. Loop through the original array and put each object in a “bucket” 3. Sort each of the non-empty buckets 4. Check the buckets in order and then put all objects back into the original array

var array = [2, 4, 1, 5, 3];
bucketSort(array);

Read More

Bubble Sort Algorithm In Javascript

Bubble Sort is a very simple sorting algorithm. It works by stepping through a list to be sorted repeatedly while comparing each pair of coinsiding items and switching them if they are ordered incorrectly. This is a useful algorithm for doing simple comparisons in lists, but there are much more efficient algorithms for larger lists.

Read More

Explanation Of How Git Works

Git is a distributed version control and source code management system. It was created originally by Linus Torvalds, who also had developed the original Linux kernel. Git is one of the most popular version control systems in use today.

Read More

Functional Programming In Javascript

Procedural programming is where you define a procedure to solve a problem. Functional (aka declarative) programming is distinct from this in that you describe the “what” of the problem. With functional programming the results depend upon only the inputs and not on the program state. JavaScript is actually a multi-paradigm language, because it supports object-oriented, imperative, and functional programming styles.

Read More

Javascript Functions As Object Constructors

JavaScript is a prototype-based language and doesn’t exactly support actual constructors, but we can sort of simulate constructors with functions. One thing to be weary of in JavaScript is scope management. JavaScript doesn’t support classes; it only has support for functions. So you would be using functions in place of classes as well. Also, scope can be an issue with the ‘this’ keyword because ‘this’ operates different than in object-oriented languages. In JavaScript, the ‘this’ keyword refers to the global scope (window object), whereas in most object-oriented languages ‘this’ refers to the parent object.

Read More

Optimizing Web Assets For Performance

Although most internet users nowadays have very fast connections it is still important to optimize your web application’s assets to ensure optimal performance. This is especially the case for mobile users, which have more constrained resources (data connections and hardware resources). There are a number of things you can do but I’lll highlight just a few that I believe are important to think about.

Read More

What Is Cross Site Scripting Xss And How To Prevent It

Cross-Site Scripting (XSS) isn’t necessarily an actual “cross-site” attack, instead its essentially an insertion of client-side script code placed strategically such that users will execute them. This is possible when output from the website isn’t properly escaped, thereby allowing extra code to be added.

Read More