Browsed by
Author: Ashwani Kumar

Technofreak, writing & reading for passion.
Caesar encryption of string using JavaScript

Caesar encryption of string using JavaScript

Caesar encryption of string is basically shifting of characters by some amount. Let me put it this way, if you’ve a string “abc” and you want it to be shifted by amount 4. i.e. “efg”. This is called Caesar encryption.

Here in this example, we are going to use concept of ASCII code. Every letter in alphabet has some decimal value assigned i.e. “a” = 97, “b” = 98 …”z” = 122 or “A” = 65, “B” = 66…”Z” = 90.

Read More Read More

How to handle Global Variable scope issue in JavaScript

How to handle Global Variable scope issue in JavaScript

One of the major problem with JavaScript is the leakage of scope and which leads to various issues as such variable name conflict. One of the best practice of JavaScript is to use to one global object variable and dynamically add variables to it or defines the variable as object property. This will restrict the variable scope and will help limit scope leakage. This way variables are restricted to one Global Variable scope.

Read More Read More