console.log("Hello, World!");
let a = "^FX Start of a new label-sheet\n^XA^MCY^XZ\n^XA\n^LH0,0\n^FO60,1515^GB1,180,5,B,0^FS\n^FO60,1515^GB150,1,5,B,0^FS\n^FO210,1515^GB1,180,5,B,0^FS\n^FO60,1695^GB150,1,5,B,0^FS\n^FO60,1535^A0,52,0^FR^FB160,1,0,C,0^FDTSMM^FS\n\n^LH0,0\n^FO210,1515^GB1,180,5,B,0^FS\n^FO210,1515^GB150,1,5,B,0^FS\n^FO360,1515^GB1,180,5,B,0^FS\n^FO210,1695^GB150,1,5,B,0^FS\n^FO210,1535^A0,52,0^FR^FB160,1,0,C,0^FDSTVN^FS\n^FO223,1603^GB40,75,40,B,0^FS\n^FO210,1612^A0,50,0^FR^FB80,1,0,C,0^FDI^FS\n^FO273,1612^A0,50,0^FR^FB200,1,0,L,0^FDN01^FS\n\n^LH0,0\n^FO360,1515^GB1,180,5,B,0^FS\n^FO360,1515^GB150,1,5,B,0^FS\n^FO510,1515^GB1,180,5,B,0^FS\n^FO360,1695^GB150,1,5,B,0^FS\n^FO360,1535^A0,52,0^FR^FB160,1,0,C,0^FDSTVV^FS\n^FO373,1603^GB40,75,40,B,0^FS\n^FO360,1612^A0,50,0^FR^FB80,1,0,C,0^FDA^FS\n^FO423,1612^A0,50,0^FR^FB200,1,0,L,0^FD44X^FS\n\n^LH0,0\n^FO510,1515^GB1,180,5,B,0^FS\n^FO510,1515^GB150,1,5,B,0^FS\n^FO660,1515^GB1,180,5,B,0^FS\n^FO510,1695^GB150,1,5,B,0^FS\n^FO510,1535^A0,52,0^FR^FB160,1,0,C,0^FDMBOX^FS\n^FO523,1603^GB40,75,40,B,0^FS\n^FO510,1612^A0,50,0^FR^FB80,1,0,C,0^FD4^FS\n^FO573,1612^A0,50,0^FR^FB200,1,0,L,0^FDG5P^FS\n\n^LH0,0\n^FO660,1515^GB1,180,5,B,0^FS\n^FO660,1515^GB150,1,5,B,0^FS\n^FO810,1515^GB1,180,5,B,0^FS\n^FO660,1695^GB150,1,5,B,0^FS\n^FO660,1535^A0,52,0^FR^FB160,1,0,C,0^FDTNAJ^FS\n\n^LH0,0\n^FO680,60^GB220,119,7,B,0^FS\n^FO580,100^A0,60,0^FR^FB430,1,0,C,0^FDSUR^FS\n^FO680,176^GB220,60,7,B,0^FS\n^FO580,190^A0,40,0^FR^FB430,1,0,C,0^FD 0.64 kgs^FS\n^CI28^FO35,1079^A0,23,0^FR^FB1100,3,0,L,0^FH^FD_53_68_6F_70_20_6E_6F_20_31_30_34_39_2D_35_30_20_46_69_72_73_74_20_46_6C_6F_6F_72_20_4D_69_6C_6C_65_6E_69_75_6D_20_54_65_78_74_69_6C_65_20_4D_61_72_6B_65_74_20_34 _4E_65_61_72_20_53_69_64_64_68_69_20_56_69_6E_61_79_61_6B_20_54_65_6D_70_6C_65_2C_42_61_6D_72_6F_6C_69_20_4B_68_61_64_69_20_42_72_69_64_67_65_2C_20_55_64_68_6E_61 _53_55_52_41_54 _47_55_4A_41_52_41_54 _33_39_34_32_31_30 _49_6E_64_69_61^FS^CI0\n^FO35,1056^A0,23,0^FR^FB600,1,0,L,0^FDShipped By: Amazon Seller Services Pvt Ltd. Return Address:^FS\n^FO680,293^GB220,100,7,B,0^FS\n^FO50,340^A0,35,0^FR^FB380,1,0,L,0^FDShip To:^FS\n^FO680,235^GB220,60,7,B,0^FS\n^FO610,580^GB180,120,7,B,0^FS\n^FO600,605^A0,19,0^FR^FB212,1,0,C,0^FDDELIVERY STATION^FS\n^FO600,640^A0,60,0^FR^FB212,1,0,C,0^FDTNAJ^FS\n^FO790,580^GB170,120,120,B,0^FS\n^FO770,605^A0,22,0^FR^FB212,1,0,C,0^FDSECTOR^FS\n^FO780,640^A0,60,0^FR^FB212,1,0,C,0^FDX^FS\n^FO960,580^GB170,120,7,B,0^FS\n^FO950,605^A0,22,0^FR^FB182,1,0,C,0^FDSORTZONE^FS\n^FO960,640^A0,60,0^FR^FB182,1,0,C,0^FDX^FS\n^BY5,5.0,200^FO80,86^BCN,200,N,N,Y,A^FD266897592657^FS\n^FO110,320^A0,35,0^FR^FB420,1,0,C,0^FDAWB ^FS\n^FO110,320^A0,35,0^FR^FB700,1,0,C,0^FD266897592657^FS\n^FO680,393^GB220,100,7,B,0^FS\n^FO685,434^A0,45,0^FR^FB220,1,0,C,0^FDPREPAID^FS\n^FO50,1720^A0,30,0^FR^FB2000,1,0,L,0^FDSold on: www.amazon.in ^FS\n^FO950,1700^A0,45,0^FR^FB200,1,0,L,0^FDATSPL^FS\n^FO60,1150^A0,24,0^FR^FB1080,4,0,L,0^FDCustomer Self Declaration : The goods sold are intended for end user consumption.Not for resale.^FS\n^FWB^FO1025,156^A0,35,0^FR^FB650,1,0,C,0^FDUnBZSVTdR^FS^FWN\n^FO900,60^GB220,119,7,B,0^FS\n^FO880,100^A0,40,0^FR^FB261,2,0,C,0^FDSUN Closed^FS\n^FO800,510^GB180,67,7,B,0^FS\n^FO825,540^A0,30,0^FR^FB200,1,0,L,0^FDBOX 1 of 1^FS\n^FO20,742^GB1145,1,1,B,0^FS\n^FO20,1055^GB1145,1,1,B,0^FS\n^FO20,1145^GB1145,1,1,B,0^FS\n^FO50,1200^GB50,50,3,B,0^FS\n^FO100,1200^GB180,50,3,B,0^FS\n^FO280,1200^GB250,50,3,B,0^FS\n^FO530,1200^GB200,50,3,B,0^FS\n^FO730,1200^GB170,50,3,B,0^FS\n^FO900,1200^GB200,50,3,B,0^FS\n^FO900,1200^GB200,50,3,B,0^FS\n^FO50,1250^GB50,50,3,B,0^FS\n^FO100,1250^GB180,50,3,B,0^FS\n^FO280,1250^GB250,50,3,B,0^FS\n^FO530,1250^GB200,50,3,B,0^FS\n^FO730,1250^GB170,50,3,B,0^FS\n^FO900,1250^GB200,50,3,B,0^FS\n^FO70,1210^A0,35,0^FR^FB200,1,0,L,0^FD#^FS\n^FO120,1210^A0,35,0^FR^FB200,1,0,L,0^FDSELLER^FS\n^FO300,1210^A0,35,0^FR^FB200,1,0,L,0^FDGSTIN^FS\n^FO550,1210^A0,35,0^FR^FB200,1,0,L,0^FDINVOICE^FS\n^FO750,1210^A0,35,0^FR^FB200,1,0,L,0^FDDATE^FS\n^FO920,1210^A0,35,0^FR^FB200,1,0,L,0^FDITEM TYPE^FS\n^FO70,1260^A0,20,0^FR^FB200,1,0,L,0^FD1^FS\n^FO120,1260^A0,20,0^FR^FB175,2,0,L,0^FDFASHION CRAFT^FS\n^FO295,1260^A0,20,0^FR^FB230,1,0,L,0^FD24ECEPM3666L1Z8^FS\n^FO545,1260^A0,20,0^FR^FB195,1,0,L,0^FDTSMM-1730^FS\n^FO925,1260^A0,20,0^FR^FB190,2,0,L,0^FDApparel^FS\n^FO0,0^A0,0,0^FR^FB0,1,0,L,0^FD^FS\n^FO0,0^A0,0,0^FR^FB0,1,0,L,0^FD^FS\n^FO0,0^A0,0,0^FR^FB0,1,0,L,0^FD^FS\n^FO580,340^A0,50,0^FR^FB430,1,0,C,0^FD29/10^FS\n^CI28^FO50,390^A0,32,0^FR^FB570,9,3,L,0^FH^FD_53_75_64_61_6D_20_62_68_6F_69_72 \\& _42_6C_75_65_20_73_74_61_72_20_6C_74_64_2E_20_77_61_64_61_20_61_74_2E_20_76_61_73_6F_72_69_20_70_6F_73_74_2E_20_20_6B_68_6F_70_72_69_20_74_61_6C_20_77_61_64_61_20_64_69_73_74_20_2E _4B_55_44_55_53 _34_32_31_33_31_32 \\& _4D_41_48_41_52_41_53_48_54_52_41 \\&Landmark: _42_6C_75_65_20_73_74_61_72_20_2E_6C_74_64_2E_77_61_64_61^FS^CI0\n\n^LH0,0\n^FO96,791^BXB,12,200,18,18,,*^FD22-UnBZSVTdR_001^FS\n^FO360,791^BXI,12,200,18,18,,*^FD22-UnBZSVTdR_001^FS\n^FO624,791^BXR,12,200,18,18,,*^FD22-UnBZSVTdR_001^FS\n^FO888,791^BXN,12,200,18,18,,*^FD22-UnBZSVTdR_001^FS\n\n^XZ"

let b = "^FX Start of a new label-sheet\n^XA^MCY^XZ\n^XA\n^LH0,0\n^FO60,1515^GB1,180,5,B,0^FS\n^FO60,1515^GB150,1,5,B,0^FS\n^FO210,1515^GB1,180,5,B,0^FS\n^FO60,1695^GB150,1,5,B,0^FS\n^FO60,1535^A0,52,0^FR^FB160,1,0,C,0^FDTSMM^FS\n\n^LH0,0\n^FO210,1515^GB1,180,5,B,0^FS\n^FO210,1515^GB150,1,5,B,0^FS\n^FO360,1515^GB1,180,5,B,0^FS\n^FO210,1695^GB150,1,5,B,0^FS\n^FO210,1535^A0,52,0^FR^FB160,1,0,C,0^FDSTVN^FS\n^FO223,1603^GB40,75,40,B,0^FS\n^FO210,1612^A0,50,0^FR^FB80,1,0,C,0^FDI^FS\n^FO273,1612^A0,50,0^FR^FB200,1,0,L,0^FDN01^FS\n\n^LH0,0\n^FO360,1515^GB1,180,5,B,0^FS\n^FO360,1515^GB150,1,5,B,0^FS\n^FO510,1515^GB1,180,5,B,0^FS\n^FO360,1695^GB150,1,5,B,0^FS\n^FO360,1535^A0,52,0^FR^FB160,1,0,C,0^FDSTVV^FS\n^FO373,1603^GB40,75,40,B,0^FS\n^FO360,1612^A0,50,0^FR^FB80,1,0,C,0^FDA^FS\n^FO423,1612^A0,50,0^FR^FB200,1,0,L,0^FD44X^FS\n\n^LH0,0\n^FO510,1515^GB1,180,5,B,0^FS\n^FO510,1515^GB150,1,5,B,0^FS\n^FO660,1515^GB1,180,5,B,0^FS\n^FO510,1695^GB150,1,5,B,0^FS\n^FO510,1535^A0,52,0^FR^FB160,1,0,C,0^FDMBOX^FS\n^FO523,1603^GB40,75,40,B,0^FS\n^FO510,1612^A0,50,0^FR^FB80,1,0,C,0^FD4^FS\n^FO573,1612^A0,50,0^FR^FB200,1,0,L,0^FDG5P^FS\n\n^LH0,0\n^FO660,1515^GB1,180,5,B,0^FS\n^FO660,1515^GB150,1,5,B,0^FS\n^FO810,1515^GB1,180,5,B,0^FS\n^FO660,1695^GB150,1,5,B,0^FS\n^FO660,1535^A0,52,0^FR^FB160,1,0,C,0^FDTNAJ^FS\n\n^LH0,0\n^FO680,60^GB220,119,7,B,0^FS\n^FO580,100^A0,60,0^FR^FB430,1,0,C,0^FDSUR^FS\n^FO680,176^GB220,60,7,B,0^FS\n^FO580,190^A0,40,0^FR^FB430,1,0,C,0^FD 0.64 kgs^FS\n^CI28^FO35,1079^A0,23,0^FR^FB1100,3,0,L,0^FH^FD_53_68_6F_70_20_6E_6F_20_31_30_34_39_2D_35_30_20_46_69_72_73_74_20_46_6C_6F_6F_72_20_4D_69_6C_6C_65_6E_69_75_6D_20_54_65_78_74_69_6C_65_20_4D_61_72_6B_65_74_20_34 _4E_65_61_72_20_53_69_64_64_68_69_20_56_69_6E_61_79_61_6B_20_54_65_6D_70_6C_65_2C_42_61_6D_72_6F_6C_69_20_4B_68_61_64_69_20_42_72_69_64_67_65_2C_20_55_64_68_6E_61 _53_55_52_41_54 _47_55_4A_41_52_41_54 _33_39_34_32_31_30 _49_6E_64_69_61^FS^CI0\n^FO35,1056^A0,23,0^FR^FB600,1,0,L,0^FDShipped By: Amazon Seller Services Pvt Ltd. Return Address:^FS\n^FO680,293^GB220,100,7,B,0^FS\n^FO50,340^A0,35,0^FR^FB380,1,0,L,0^FDShip To:^FS\n^FO680,235^GB220,60,7,B,0^FS\n^FO610,580^GB180,120,7,B,0^FS\n^FO600,605^A0,19,0^FR^FB212,1,0,C,0^FDDELIVERY STATION^FS\n^FO600,640^A0,60,0^FR^FB212,1,0,C,0^FDTNAJ^FS\n^FO790,580^GB170,120,120,B,0^FS\n^FO770,605^A0,22,0^FR^FB212,1,0,C,0^FDSECTOR^FS\n^FO780,640^A0,60,0^FR^FB212,1,0,C,0^FDX^FS\n^FO960,580^GB170,120,7,B,0^FS\n^FO950,605^A0,22,0^FR^FB182,1,0,C,0^FDSORTZONE^FS\n^FO960,640^A0,60,0^FR^FB182,1,0,C,0^FDX^FS\n^BY5,5.0,200^FO80,86^BCN,200,N,N,Y,A^FD266897592657^FS\n^FO110,320^A0,35,0^FR^FB420,1,0,C,0^FDAWB ^FS\n^FO110,320^A0,35,0^FR^FB700,1,0,C,0^FD266897592657^FS\n^FO680,393^GB220,100,7,B,0^FS\n^FO685,434^A0,45,0^FR^FB220,1,0,C,0^FDPREPAID^FS\n^FO50,1720^A0,30,0^FR^FB2000,1,0,L,0^FDSold on: www.amazon.in ^FS\n^FO950,1700^A0,45,0^FR^FB200,1,0,L,0^FDATSPL^FS\n^FO60,1150^A0,24,0^FR^FB1080,4,0,L,0^FDCustomer Self Declaration : The goods sold are intended for end user consumption.Not for resale.^FS\n^FWB^FO1025,156^A0,35,0^FR^FB650,1,0,C,0^FDUnBZSVTdR^FS^FWN\n^FO900,60^GB220,119,7,B,0^FS\n^FO880,100^A0,40,0^FR^FB261,2,0,C,0^FDSUN Closed^FS\n^FO800,510^GB180,67,7,B,0^FS\n^FO825,540^A0,30,0^FR^FB200,1,0,L,0^FDBOX 1 of 1^FS\n^FO20,742^GB1145,1,1,B,0^FS\n^FO20,1055^GB1145,1,1,B,0^FS\n^FO20,1145^GB1145,1,1,B,0^FS\n^FO50,1200^GB50,50,3,B,0^FS\n^FO100,1200^GB180,50,3,B,0^FS\n^FO280,1200^GB250,50,3,B,0^FS\n^FO530,1200^GB200,50,3,B,0^FS\n^FO730,1200^GB170,50,3,B,0^FS\n^FO900,1200^GB200,50,3,B,0^FS\n^FO900,1200^GB200,50,3,B,0^FS\n^FO50,1250^GB50,50,3,B,0^FS\n^FO100,1250^GB180,50,3,B,0^FS\n^FO280,1250^GB250,50,3,B,0^FS\n^FO530,1250^GB200,50,3,B,0^FS\n^FO730,1250^GB170,50,3,B,0^FS\n^FO900,1250^GB200,50,3,B,0^FS\n^FO70,1210^A0,35,0^FR^FB200,1,0,L,0^FD#^FS\n^FO120,1210^A0,35,0^FR^FB200,1,0,L,0^FDSELLER^FS\n^FO300,1210^A0,35,0^FR^FB200,1,0,L,0^FDGSTIN^FS\n^FO550,1210^A0,35,0^FR^FB200,1,0,L,0^FDINVOICE^FS\n^FO750,1210^A0,35,0^FR^FB200,1,0,L,0^FDDATE^FS\n^FO920,1210^A0,35,0^FR^FB200,1,0,L,0^FDITEM TYPE^FS\n^FO70,1260^A0,20,0^FR^FB200,1,0,L,0^FD1^FS\n^FO120,1260^A0,20,0^FR^FB175,2,0,L,0^FDFASHION CRAFT^FS\n^FO295,1260^A0,20,0^FR^FB230,1,0,L,0^FD24ECEPM3666L1Z8^FS\n^FO545,1260^A0,20,0^FR^FB195,1,0,L,0^FDTSMM-1730^FS\n^FO925,1260^A0,20,0^FR^FB190,2,0,L,0^FDApparel^FS\n^FO0,0^A0,0,0^FR^FB0,1,0,L,0^FD^FS\n^FO0,0^A0,0,0^FR^FB0,1,0,L,0^FD^FS\n^FO0,0^A0,0,0^FR^FB0,1,0,L,0^FD^FS\n^FO580,340^A0,50,0^FR^FB430,1,0,C,0^FD29/10^FS\n^CI28^FO50,390^A0,32,0^FR^FB570,9,3,L,0^FH^FD_53_75_64_61_6D_20_62_68_6F_69_72 \\& _42_6C_75_65_20_73_74_61_72_20_6C_74_64_2E_20_77_61_64_61_20_61_74_2E_20_76_61_73_6F_72_69_20_70_6F_73_74_2E_20_20_6B_68_6F_70_72_69_20_74_61_6C_20_77_61_64_61_20_64_69_73_74_20_2E _4B_55_44_55_53 _34_32_31_33_31_32 \\& _4D_41_48_41_52_41_53_48_54_52_41 \\&Landmark: _42_6C_75_65_20_73_74_61_72_20_2E_6C_74_64_2E_77_61_64_61^FS^CI0\n\n^LH0,0\n^FO96,791^BXB,12,200,18,18,,*^FD22-UnBZSVTdR_001^FS\n^FO360,791^BXI,12,200,18,18,,*^FD22-UnBZSVTdR_001^FS\n^FO624,791^BXR,12,200,18,18,,*^FD22-UnBZSVTdR_001^FS\n^FO888,791^BXN,12,200,18,18,,*^FD22-UnBZSVTdR_001^FS\n\n^XZ"

if(a === b) {
  console.log("1111111")
} 
by

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");