Real-time Javascript failures

Javascript is the core Language of all the major client-side framework. It was invented by Brendan Eich on 1995. Nowadays, We cannot see websites or web-based applications without Javascript programming. You can use the Javascript to build web and mobile apps, real-time networking apps, command-line tools, and games.

Every Language has its own strengths and drawbacks reside in it.

String as a Number

It’s a strange behavior of Javascript. Consider declaring the numeric values as a string and do the Arithmetic operation, the Subtraction, division, and multiplication operations are performed correctly. But while doing Addition, the strings are getting concatenated and returned the value.

Javascript Arithmetic Operation

Arithmetic operation

While handling the float type values in an arithmetic operation, the Javascript returns the invalid values. Javascript language doesn’t have an integer data type. Other than this language all the other languages are have an Integer data type.

It returns the unexpected results to the Addition operation. The original result cannot be equal to the arithmetic result.

Javascript issues with Float data type in Arithmetic operation

Math Function

The individual Math functions are worked fine. But Comparision function between two Math function makes the Javascript failed again.

Math calculation failure in Javascript

Multiple Variable Declaration

In Javascript, we are able to declare the same variable multiple times as below,

var a, a, a;
var a;
var a;
Multiple variable declaration in Javascript

Top BI tools in the market


2 Pings/Trackbacks for "Real-time Javascript failures"
  1. […] Javascript also has its own strength and weakness. In my previous blog, I have written about the failures of Javascript and it is true. In this blog, I am going to discuss Javascript […]

Leave a Reply

Join with us to learn more

Please wait...
You will be notified when we have tips and tricks