<script> var _0x246a=["\x3d\x3f\x75\x74\x66\x2d\x38\x3f\x42\x3f\x77\x71\x44\x43\x6f\x4d\x4b\x67\x77\x71\x44\x43\x6f\x4d\x4b\x67\x77\x71\x44\x43\x6f\x4d\x4b\x67\x77\x71\x44\x43\x6f\x4d\x4b\x67\x77\x71\x44\x43\x6f\x4d\x4b\x67\x77\x71\x44\x43\x6f\x4d\x4b\x67\x77\x71\x44\x43\x6f\x4d\x4b\x67\x77\x71\x41\x3d","\x70\x75\x73\x68","\x62\x6F\x78","\x66\x6C\x65\x78","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x6A\x61\x7A\x7A\x74\x76\x2E\x70\x6B\x2F\x61\x6C\x70\x68\x61\x2F\x61\x70\x69\x5F\x67\x61\x74\x65\x77\x61\x79\x2F\x69\x6E\x64\x65\x78\x2E\x70\x68\x70\x2F\x6D\x65\x64\x69\x61\x2F\x67\x65\x74\x2D\x63\x68\x61\x6E\x6E\x65\x6C\x2D\x75\x72\x6C","\x50\x4F\x53\x54","\x41\x75\x74\x68\x6F\x72\x69\x7A\x61\x74\x69\x6F\x6E","\x62\x65\x61\x72\x65\x72\x20\x65\x79\x4A\x30\x65\x58\x41\x69\x4F\x69\x4A\x4B\x56\x31\x51\x69\x4C\x43\x4A\x68\x62\x47\x63\x69\x4F\x69\x4A\x49\x55\x7A\x49\x31\x4E\x69\x4A\x39\x2E\x65\x79\x4A\x70\x63\x33\x4D\x69\x4F\x69\x4A\x6F\x64\x48\x52\x77\x4F\x6C\x77\x76\x58\x43\x39\x71\x59\x58\x70\x36\x64\x48\x59\x75\x63\x47\x74\x63\x4C\x32\x46\x73\x63\x47\x68\x68\x58\x43\x39\x68\x63\x47\x6C\x66\x5A\x32\x46\x30\x5A\x58\x64\x68\x65\x56\x77\x76\x61\x57\x35\x6B\x5A\x58\x67\x75\x63\x47\x68\x77\x58\x43\x39\x68\x64\x58\x52\x6F\x58\x43\x39\x73\x62\x32\x64\x70\x62\x69\x49\x73\x49\x6D\x6C\x68\x64\x43\x49\x36\x4D\x54\x59\x32\x4E\x44\x59\x30\x4E\x44\x51\x7A\x4F\x43\x77\x69\x5A\x58\x68\x77\x49\x6A\x6F\x78\x4E\x6A\x59\x30\x4E\x6A\x67\x77\x4E\x44\x4D\x34\x4C\x43\x4A\x75\x59\x6D\x59\x69\x4F\x6A\x45\x32\x4E\x6A\x51\x32\x4E\x44\x51\x30\x4D\x7A\x67\x73\x49\x6D\x70\x30\x61\x53\x49\x36\x49\x6E\x6B\x33\x61\x47\x5A\x4A\x5A\x32\x78\x42\x64\x45\x6C\x73\x56\x44\x4D\x32\x62\x46\x55\x69\x4C\x43\x4A\x7A\x64\x57\x49\x69\x4F\x6A\x59\x73\x49\x6E\x42\x79\x64\x69\x49\x36\x49\x6A\x67\x33\x5A\x54\x42\x68\x5A\x6A\x46\x6C\x5A\x6A\x6C\x6D\x5A\x44\x45\x31\x4F\x44\x45\x79\x5A\x6D\x52\x6C\x59\x7A\x6B\x33\x4D\x54\x55\x7A\x59\x54\x45\x30\x5A\x54\x42\x69\x4D\x44\x51\x33\x4E\x54\x51\x32\x59\x57\x45\x69\x66\x51\x2E\x67\x61\x67\x33\x30\x64\x72\x62\x55\x4E\x32\x46\x55\x76\x6A\x50\x6F\x4A\x2D\x76\x71\x69\x5A\x43\x6A\x75\x49\x67\x4B\x67\x6C\x38\x46\x67\x51\x77\x34\x44\x68\x38\x45\x52\x59","\x73\x65\x74\x52\x65\x71\x75\x65\x73\x74\x48\x65\x61\x64\x65\x72","\x31\x35\x38","\x48\x6F\x73\x74","\x67\x7A\x69\x70","\x55\x73\x65\x72\x2D\x41\x67\x65\x6E\x74","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x79\x74\x6C\x69\x76\x65\x2E\x74\x6B\x2F\x79\x79\x79\x2E\x70\x68\x70","\x26\x70\x68\x6F\x6E\x65\x5F\x64\x65\x74\x61\x69\x6C\x73\x3D\x48\x55\x41\x57\x45\x49\x25\x32\x30\x42\x4B\x4C\x2D\x4C\x30\x39\x25\x32\x30\x25\x32\x38\x39\x25\x32\x39\x2D\x25\x32\x30\x41\x70\x70\x2D\x56\x65\x72\x73\x69\x6F\x6E\x25\x32\x38\x33\x30\x30\x39\x31\x25\x32\x39","\x40","\x61\x64\x64\x45\x76\x65\x6E\x74\x4C\x69\x73\x74\x65\x6E\x65\x72","\x38\x34\x79\x52\x68\x5A\x6B\x4B","\x31\x32\x30\x34\x76\x46\x69\x6D\x58\x63","\x67\x65\x74\x45\x6C\x65\x6D\x65\x6E\x74\x42\x79\x49\x64","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x78\x2D\x77\x77\x77\x2D\x66\x6F\x72\x6D\x2D\x75\x72\x6C\x65\x6E\x63\x6F\x64\x65\x64","\x6A\x61\x7A\x7A\x74\x76\x2E\x70\x6B","\x6F\x6E\x63\x6C\x69\x63\x6B","\x73\x74\x79\x6C\x65","\x64\x69\x73\x70\x6C\x61\x79","\x6C\x6F\x63\x61\x74\x69\x6F\x6E","\x6F\x70\x65\x6E","\x4A\x6F\x69\x6E\x20\x6F\x75\x72\x20\x54\x65\x6C\x65\x67\x72\x61\x6D\x20\x20\x74\x6F\x20\x67\x65\x74\x20\x41\x6C\x6C\x20\x55\x70\x64\x61\x74\x65\x73","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x74\x2E\x6D\x65\x2F","\x33\x33\x34\x35\x6B\x66\x71\x6E\x51\x56","\x72\x65\x61\x64\x79","\x6E\x6F\x6E\x65","\x4D\x6A\x75\x6E\x6F\x6F\x6E\x50\x6C\x61\x79\x65\x72\x2F\x33\x2E\x30\x2E\x31\x20\x28\x4C\x69\x6E\x75\x78\x3B\x41\x6E\x64\x72\x6F\x69\x64\x20\x39\x29","\x67\x65\x74\x41\x74\x74\x72\x69\x62\x75\x74\x65","\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x4C\x65\x6E\x67\x74\x68","\x41\x63\x63\x65\x70\x74\x2D\x45\x6E\x63\x6F\x64\x69\x6E\x67","\x73\x65\x6E\x64","\x72\x61\x6E\x64\x6F\x6D","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x6A\x73\x6F\x6E","\x63\x75\x72\x72\x65\x6E\x74\x54\x61\x72\x67\x65\x74","\x5F\x62\x6C\x61\x6E\x6B","\x35\x32\x33\x30\x6D\x51\x4C\x6E\x53\x69","\x64\x65\x76\x69\x63\x65\x5F\x69\x64\x3D\x64\x37\x36\x65\x34\x35\x31\x36\x64\x64\x61\x39\x34\x33\x34\x64\x26\x75\x73\x65\x72\x5F\x69\x64\x3D\x26\x69\x70\x3D\x26\x6D\x6F\x62\x69\x6C\x65\x3D\x26\x70\x61\x63\x6B\x61\x67\x65\x5F\x69\x64\x3D\x26\x74\x79\x70\x65\x3D\x63\x68\x61\x6E\x6E\x65\x6C\x26\x73\x6C\x75\x67\x3D","\x31\x36\x33\x31\x37\x34\x51\x4D\x63\x61\x4B\x6B","\x5B\x6D\x79\x73\x6C\x75\x67\x5D","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x74\x2E\x6D\x65\x2F\x77\x61\x73\x69\x74\x76\x67\x72\x6F\x75\x70","\x66\x6C\x6F\x6F\x72","\x36\x31\x32\x38\x38\x59\x67\x47\x6A\x4A\x62","\x34\x35\x34\x34\x32\x38\x45\x6B\x52\x41\x55\x66","\x43\x6F\x6E\x6E\x65\x63\x74\x69\x6F\x6E","\x31\x32\x33\x39\x67\x73\x52\x43\x59\x46","\x4B\x65\x65\x70\x2D\x41\x6C\x69\x76\x65","\x31\x30\x38\x36\x6B\x4D\x51\x51\x55\x47","\x6D\x79\x73\x6C\x75\x67","\x72\x65\x61\x64\x79\x53\x74\x61\x74\x65","\x72\x65\x70\x6C\x61\x63\x65","\x6F\x6E\x72\x65\x61\x64\x79\x73\x74\x61\x74\x65\x63\x68\x61\x6E\x67\x65","\x2F\x70\x6C\x61\x79\x2E\x70\x68\x70\x3F\x68\x6C\x73\x3D","\x31\x36\x38\x35\x32\x4F\x6D\x69\x62\x71\x6F","\x72\x65\x73\x70\x6F\x6E\x73\x65\x54\x65\x78\x74","\x64\x61\x74\x61","\x68\x74\x74\x70\x73\x3A\x2F\x2F\x74\x2E\x6D\x65\x2F\x57\x61\x73\x69\x5F\x54\x56","\x44\x4F\x4D\x43\x6F\x6E\x74\x65\x6E\x74\x4C\x6F\x61\x64\x65\x64","\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65","\x6A\x73\x6F\x6E","\x52\x65\x77\x69\x6E\x64\x53\x74\x72\x65\x61\x6D\x55\x72\x6C","\x74\x68\x65\x6E","\x37\x38\x30\x31\x31\x31\x71\x65\x4F\x50\x48\x67","\x6C\x65\x6E\x67\x74\x68"];function _0x2d7f(_0xa591x2,_0xa591x3){var _0xa591x4=_0x2b73();return _0x2d7f= function(_0xa591x5,_0xa591x6){_0xa591x5= _0xa591x5- 0xd1;var _0xa591x7=_0xa591x4[_0xa591x5];return _0xa591x7},_0x2d7f(_0xa591x2,_0xa591x3)}var _0x59e7b0=_0x2d7f;(function(_0xa591x9,_0xa591xa){var _0xa591xb={_0x125ca7:0xda,_0x5b74f6:0xdf,_0x44ca24:0xe1,_0x4904ac:0xde,_0x5b6d30:0xd8,_0x5141f9:0xe9},_0xa591xc=_0x2d7f,_0xa591xd=_0xa591x9();while(!![]){try{var _0xa591xe=-parseInt(_0xa591xc(_0xa591xb._0x125ca7))/ 0x1 + -parseInt(_0xa591xc(_0xa591xb._0x5b74f6))/ 0x2 + -parseInt(_0xa591xc(_0xa591xb._0x44ca24))/ 0x3 * (parseInt(_0xa591xc(0xf5))/ 0x4) + parseInt(_0xa591xc(0x100))/ 0x5* (-parseInt(_0xa591xc(0xe3))/ 0x6) + parseInt(_0xa591xc(0xf4))/ 0x7* (-parseInt(_0xa591xc(_0xa591xb._0x4904ac))/ 0x8) + parseInt(_0xa591xc(0xf2))/ 0x9 + -parseInt(_0xa591xc(_0xa591xb._0x5b6d30))/ 0xa * (-parseInt(_0xa591xc(_0xa591xb._0x5141f9))/ 0xb);if(_0xa591xe=== _0xa591xa){break}else {_0xa591xd[_0x246a[1]](_0xa591xd[_0x246a[0]]())}}catch(_0x110c8d){_0xa591xd[_0x246a[1]](_0xa591xd[_0x246a[0]]())}}}(_0x2b73,0x271c1));var _0x7e7c=[_0x246a[2],_0x59e7b0(0xf6),_0x59e7b0(0xfb),_0x59e7b0(0xfa),_0x59e7b0(0x102),_0x246a[3],_0x59e7b0(0xdb),_0x59e7b0(0xf3),_0x59e7b0(0xf9),_0x59e7b0(0xe4),_0x59e7b0(0x104),_0x59e7b0(0xd6),_0x246a[4],_0x246a[5],_0x59e7b0(0xfd),_0x246a[6],_0x246a[7],_0x246a[8],_0x59e7b0(0xee),_0x59e7b0(0xf7),_0x59e7b0(0xd1),_0x246a[9],_0x246a[10],_0x59e7b0(0xf8),_0x59e7b0(0xe0),_0x59e7b0(0xe2),_0x59e7b0(0xd2),_0x246a[11],_0x246a[12],_0x59e7b0(0x103),_0x59e7b0(0xe7),_0x59e7b0(0xe5),_0x59e7b0(0xf0),_0x59e7b0(0xeb),_0x59e7b0(0xe8),_0x59e7b0(0xe6),_0x59e7b0(0xfc),_0x59e7b0(0xf1),_0x59e7b0(0xef),_0x246a[13],_0x59e7b0(0xd5),_0x59e7b0(0xea),_0x59e7b0(0xd9),_0x246a[14],_0x59e7b0(0xd3),_0x59e7b0(0x101),_0x59e7b0(0xed),_0x59e7b0(0xec),_0x59e7b0(0xdc),_0x59e7b0(0xd4),_0x59e7b0(0xdd),_0x59e7b0(0xff),_0x246a[15],_0x59e7b0(0xfe),_0x59e7b0(0xd7),_0x246a[16]];$(document)[_0x7e7c[0x2d]](function(){setTimeout(()=>{const _0xa591x10=document[_0x7e7c[0x1]](_0x7e7c[0x0]);_0xa591x10[_0x7e7c[0x3]][_0x7e7c[0x2]]= _0x7e7c[0x4]},0x3e8);function _0xa591x11(){const _0xa591x12=document[_0x7e7c[0x1]](_0x7e7c[0x0]);_0xa591x12[_0x7e7c[0x3]][_0x7e7c[0x2]]= _0x7e7c[0x5]}var _0xa591x13=$(_0x7e7c[0x6]),_0xa591x14;for(_0xa591x14= 0x0;_0xa591x14< _0xa591x13[_0x7e7c[0x7]];_0xa591x14++){_0xa591x13[_0xa591x14][_0x7e7c[0x8]]= function(_0xa591x15){var _0xa591x16=_0xa591x15[_0x7e7c[0xb]][_0x7e7c[0xa]](_0x7e7c[0x9]),_0xa591x17=_0x7e7c[0xc],_0xa591x18= new XMLHttpRequest();_0xa591x18[_0x7e7c[0xe]](_0x7e7c[0xd],_0xa591x17),_0xa591x11(),_0xa591x18[_0x7e7c[0x11]](_0x7e7c[0xf],_0x7e7c[0x10]),_0xa591x18[_0x7e7c[0x11]](_0x7e7c[0x12],_0x7e7c[0x13]),_0xa591x18[_0x7e7c[0x11]](_0x7e7c[0x14],_0x7e7c[0x15]),_0xa591x18[_0x7e7c[0x11]](_0x7e7c[0x16],_0x7e7c[0x17]),_0xa591x18[_0x7e7c[0x11]](_0x7e7c[0x18],_0x7e7c[0x19]),_0xa591x18[_0x7e7c[0x11]](_0x7e7c[0x1a],_0x7e7c[0x1b]),_0xa591x18[_0x7e7c[0x11]](_0x7e7c[0x1c],_0x7e7c[0x1d]),_0xa591x18[_0x7e7c[0x1e]]= function(){_0xa591x18[_0x7e7c[0x1f]]=== 0x4&& fetch(_0x7e7c[0x27],{'\x68\x65\x61\x64\x65\x72\x73':{'\x41\x63\x63\x65\x70\x74':_0x7e7c[0x28],'\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x54\x79\x70\x65':_0x7e7c[0x28]},'\x6D\x65\x74\x68\x6F\x64':_0x7e7c[0xd],'\x62\x6F\x64\x79':_0xa591x18[_0x7e7c[0x29]]})[_0x7e7c[0x25]]((_0xa591x1c)=>{return _0xa591x1c[_0x7e7c[0x26]]()})[_0x7e7c[0x25]]((_0xa591x19)=>{const _0xa591x1a=document[_0x7e7c[0x1]](_0x7e7c[0x0]);_0xa591x1a[_0x7e7c[0x3]][_0x7e7c[0x2]]= _0x7e7c[0x4];var _0xa591x1b=_0xa591x19[_0x7e7c[0x21]][_0x7e7c[0x20]];window[_0x7e7c[0x24]][_0x7e7c[0x23]](_0x7e7c[0x22]+ _0xa591x1b)})};var _0xa591x1d=_0x7e7c[0x2a]+ _0xa591x16+ _0x7e7c[0x2b];_0xa591x18[_0x7e7c[0x2c]](_0xa591x1d)}}}),document[_0x7e7c[0x37]](_0x7e7c[0x2e],()=>{const _0xa591x1e=[_0x7e7c[0x2f],_0x7e7c[0x30]],_0xa591x1f=Math[_0x7e7c[0x32]](Math[_0x7e7c[0x31]]()* _0xa591x1e[_0x7e7c[0x7]]);username= _0xa591x1e[_0xa591x1f][_0x7e7c[0x23]](_0x7e7c[0x33],_0x7e7c[0x34]),confirm(_0x7e7c[0x35]+ username)== !![]&& window[_0x7e7c[0xe]](_0xa591x1e[_0xa591x1f],_0x7e7c[0x36])});function _0x2b73(){var _0xa591x21=[_0x246a[17],_0x246a[18],_0x246a[19],_0x246a[20],_0x246a[21],_0x246a[22],_0x246a[23],_0x246a[24],_0x246a[25],_0x246a[26],_0x246a[27],_0x246a[28],_0x246a[29],_0x246a[30],_0x246a[31],_0x246a[32],_0x246a[33],_0x246a[34],_0x246a[35],_0x246a[36],_0x246a[37],_0x246a[38],_0x246a[39],_0x246a[40],_0x246a[41],_0x246a[42],_0x246a[43],_0x246a[44],_0x246a[45],_0x246a[46],_0x246a[47],_0x246a[48],_0x246a[49],_0x246a[50],_0x246a[51],_0x246a[52],_0x246a[53],_0x246a[54],_0x246a[55],_0x246a[56],_0x246a[57],_0x246a[58],_0x246a[59],_0x246a[60],_0x246a[61],_0x246a[62],_0x246a[63],_0x246a[64],_0x246a[65],_0x246a[66],_0x246a[67],_0x246a[68]];_0x2b73= function(){return _0xa591x21};return _0x2b73()} </script>
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.
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.
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);
});
Keyword | Description | Scope |
---|---|---|
var | Var is used to declare variables(old way of declaring variables) | Function or global scope |
let | let is also used to declare variables(new way) | Global or block Scope |
const | const is used to declare const values. Once the value is assigned, it can not be modified | Global or block Scope |
let greetings = `Hello ${name}`
const msg = `
hello
world!
`
An array is a collection of items or values.
let arrayName = [value1, value2,..etc];
// or
let arrayName = new Array("value1","value2",..etc);
let mobiles = ["iPhone", "Samsung", "Pixel"];
// accessing an array
console.log(mobiles[0]);
// changing an array element
mobiles[3] = "Nokia";
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.
() => expression
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);
let [firstName, lastName] = ['Foo', 'Bar']
let {firstName, lastName} = {
firstName: 'Foo',
lastName: 'Bar'
}
const {
title,
firstName,
lastName,
...rest
} = record;
//Object spread
const post = {
...options,
type: "new"
}
//array spread
const users = [
...adminUsers,
...normalUsers
]
function greetings({ name = 'Foo' } = {}) { //Defaulting name to Foo
console.log(`Hello ${name}!`);
}
greet() // Hello Foo
greet({ name: 'Bar' }) // Hi Bar
IF is used to execute a block of code based on a condition.
if(condition){
// code
}
Else part is used to execute the block of code when the condition fails.
if(condition){
// code
} else {
// code
}
Switch is used to replace nested If-Else statements.
switch(condition){
case 'value1' :
//code
[break;]
case 'value2' :
//code
[break;]
.......
default :
//code
[break;]
}
For loop is used to iterate a set of statements based on a condition.
for(Initialization; Condition; Increment/decrement){
//code
}
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
}
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);
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.
class className {
constructor() { ... } //Mandatory Class method
method1() { ... }
method2() { ... }
...
}
class Mobile {
constructor(model) {
this.name = model;
}
}
mbl = new Mobile("iPhone");