Showing 1 to 8 of 35 posts.

Closures JavaScript vs Swift

Posted on January 12th, 2020 in JavaScript by George

Today I would like to bring forward comparison between closures in JavaScript to closures in Swift. 

Just to make it clear, Swift is not the same or like JavaScript. 

Swift, it is a static typed multi-paradigm, object-orientated language, JavaScript is object-orientated prototype-based language (despite the syntactic sugar added with ES6 class, constructor, etc) 

Whenever you get to use one of the main frameworks abstracted on top of each of these two programming languages you will feel the difference.

They have a very different history and different purposes (of course there are some middle grounds, as a matter of perspective).

Both languages are borrowing syntax and programing methodologies from other programming languages. And that is a good thing.

This is not the topic of this post though.

Let's get started.




Linked list in JavaScript code example step by step

Posted on December 1st, 2019 in JavaScript by George


This is one way of implementing the Data Structure of type Linked List in JavaScript.

Follow the code example below and pay attention to the explicit comments.

I do focus on coding and not writing a descriptive article. I believe the best way to learn code is by reading code and writing code.

Thank you.


smallest multiple shortest solution JavaScript

Posted on October 2nd, 2019 in JavaScript by George

function sM(v,p) {
const g=(a,b)=>b===0||a===0?a+b:g(b,a%b),l=(a,b)=>a*b/g(a,b);
let m=p?v:1,x=p?p:v,c=m;
return c;

// provide one or two numbers(subsequent)


React mixins, Why use mixins?

Posted on January 23rd, 2019 in JavaScript by George

First of all, the reason for wich I would avoid to use mixins is that you ar are bound to use React.createClass() or create-class-module, ES6 classes are not compatibile with React mixins. 

If you are not familiar with how mixins look like, take a look at the following example:


var PureRenderMixin = require('react-addons-pure-render-mixin');

var Button = React.createClass({
  mixins: [PureRenderMixin],

  // ...





How to center fixed elements with JavaScript and jQuery

Posted on November 20th, 2018 in JavaScript by George

Sometime using top, right, bottom and left on a fixed element is not enough. 

I am sure you have been in the situation when you want to center a div container, image or other any html element which is position fixed.  In this article you will find out how to center any block element in the center of the screen using JavaScript and jQuery.

This is going to be achived using jQuery but can be done with plain JavaScript as well.

Follow the article to find out more.


Hash Table in Javascript

Posted on October 9th, 2018 in JavaScript

Dummy hash table for freeCodeCamp.


PHP casting and JavaScript coercion

Posted on September 28th, 2018 in PhP, JavaScript by George

PHP and JavaScript do not require explicit type definiton whenever you are creating a variable.The variable type is going to be defined by the context in wich the variable is assigned.Converting a data type using an explicit method it is called casting while converting a data type using an implicit (forced way) it called coercion. But what is PHP casting and what is JavaScript coercion? Are they alike? or are they different ? Read the article to find out what casting and coercion are and the syntax for each of the two languages.



Effective JavaScript Merge sort algorithm

Posted on September 27th, 2018 in JavaScript by George

Merge sort it is very effective sorting algorithm with an Worst Time complexity of  O(n log(n)) being more effective in comparison with Quick sort   O(n^2) and insertion sort   O(n^2) for a hypothetical large data set.