JavaScript

Showing 1 to 5 of 13 posts.

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:

ES5

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

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

  // ...

});

 

 

Read more...

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.

Read more...

Hash Table in Javascript

Posted on October 9th, 2018 in JavaScript

Dummy hash table for freeCodeCamp.

Read more...

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.

 

Read more...

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. 

 

Read more...

Categories