var str = `Ashish Kumar Dutta <[email protected]>; Vishwaradhya Gouder <[email protected]>; Veeramani Mididhodi <[email protected]>; Tamilselvan Kumarasamy <[email protected]>; Jayateerth Patil <[email protected]>; Aditya Srivastava <[email protected]>; Sai Siddhanth A <[email protected]>; Ajay S <[email protected]>; Abdul Subur Mohammed <[email protected]>; Arjun Singh <[email protected]>; Divya Vaish <[email protected]>; Durgadevi P <[email protected]>; Ranganath kurapati <[email protected]>; Manish Kumar <[email protected]>; Murthy G.S.N <[email protected]>; Nikhil Nandanwar <[email protected]>; Pooja Naganalli <[email protected]>; Pramila Kannappan <[email protected]>; Prantik Mukherjee <[email protected]>; Sagar Jain <[email protected]>; Sumedh Parandkar <[email protected]>; Zia Shaikh <[email protected]>; Ankur Kamboj <[email protected]>; Krishna Manoj Telaprolu <[email protected]>; Sudipta Mandal <[email protected]>; Bhaskar Basireddy <[email protected]>; Kush Verma <[email protected]>; Lohit Kad <[email protected]>; Mahammad Iliyaz Patan <[email protected]>; Nupur Thakur <[email protected]>; Ram Narayan <[email protected]>; Rashmi Jagadeesh <[email protected]>; Ankur Jain <[email protected]>; Jani Bash Shaik <[email protected]>; Ganesh Assuru <[email protected]>; Abhishek Satti <[email protected]>; Ashu Narula <[email protected]>; Sandeep Chaudhari <[email protected]>; Vidhya Nadarajan <[email protected]>; Mahesh Arram <[email protected]>; Naga Prasanthi Sagi <[email protected]>; Jaydeep Deoghare <[email protected]>; Nishant Sagar <[email protected]>; Ishita Raj <[email protected]>; Rahul Prasad <[email protected]>; PRIYA PATIL <[email protected]>; Suresh Srinivasan <[email protected]>; Venkateswaran Murali <[email protected]>; AMIT KALAGI <[email protected]>; Abhilash Kurup <[email protected]>; Vivek Krishnan <[email protected]>; Suresh Paragiri <[email protected]>; Alagesan Muthu <[email protected]>; Chette Ganga Bhavani <[email protected]>; Durgaprakash A <[email protected]>; Purshottam Kumar <[email protected]>; Seva Kamalam <[email protected]>; Kaligotla Kapil <[email protected]>; Prasadi Ravikiran <[email protected]>; Bhaskararao Salapu <[email protected]>; Kiran M V <[email protected]>; Sayan Chowdhury <[email protected]>; Kishoorkumar Ramasamy <[email protected]>; Jane Lobo <[email protected]>; Satyanarayana Jalluri <[email protected]>; Rakesh Pashupatimath <[email protected]>; Isikapalli Ajay Kumar <[email protected]>; SUSHIL KUMAR MISHRA <[email protected]>; Appalanaidu Boorle <[email protected]>; Pankaj Kulkarni <[email protected]>; Gopinadh Simhadri <[email protected]>; Sibina S <[email protected]>; V BHAVYA <[email protected]>; Ganga K <[email protected]>; Garima Shahi <[email protected]>; Tanu Garg <[email protected]>; Karan Kapoor <[email protected]>; Kumar Mithilesh <[email protected]>; Mohamed Ibrahim Hasan Jabir <[email protected]>; Sanket Rakhasiya <[email protected]>; Keerthi Sohana Atluri <[email protected]>; Sateesh Palavalasa <[email protected]>; Rishabh Sharma <[email protected]>; Dimpal Patel <[email protected]>; Suman Dash <[email protected]>; Sampath Kumar Vijayakumar <[email protected]>; Dillip Kumar Pattanaik <[email protected]>; Biswadeep Bhowal <[email protected]>; Kandulapati Srikrishna <[email protected]>; Monika Swapnil Deshmukh <[email protected]>; Vicky Kumar <[email protected]>; Arun Jayakumar <[email protected]>; Jayalakshmi Sivashankar <[email protected]>; Mahesh Arlagadda <[email protected]>; Keerti Mathad <[email protected]>; Mainak Mallick <[email protected]>; Ganesh Prabhakar <[email protected]>; Kosireddi Sreeram <[email protected]>; Rajendra Barhate <[email protected]>; Jagadish Prasad Vayada <[email protected]>; Manideep Pranav Madala <[email protected]>; Amith Gope <[email protected]>; Monish Kumar S B <[email protected]>; Praveen Kumar Baskaran <[email protected]>; Surendar Rajasekaran <[email protected]>; Priyanka Kumari <[email protected]>; Moumita Samanta <[email protected]>; Srija Bhattacharjee <[email protected]>; Chithra Radhakrishnan <[email protected]>; Paladi Dheeraj <[email protected]>; Anand Singh Rawat <[email protected]>; Vedasubramanian Muthuswamy <[email protected]>; Anupam Rana <[email protected]>; Shivani Singh <[email protected]>; Vivekananda Swain <[email protected]>; Sudhan Saravanan <[email protected]>; Neetha John <[email protected]>; Vijayalakshmi Gopal <[email protected]>; Kalpana Neelamegam Jegadeesan <[email protected]>; Priyank Agarwal <[email protected]>; Mohammed Ashik <[email protected]>; Anas Mansuri <[email protected]>; Soujanya Havanagi <[email protected]>; Ajay Reddy <[email protected]>; Priyanka Thangaraj <[email protected]>; Giri Nimmala <[email protected]>; Sundaravel E <[email protected]>; Sujith V V <[email protected]>; Yash Jadhav <[email protected]>; Jahnavi Chilumula <[email protected]>; Pooja Sunki <[email protected]>; Neha Singh <[email protected]>; Anil Gawade <[email protected]>; Amita Gunaga <[email protected]>; Suma Varkey <[email protected]>; Arunav Dutta <[email protected]>; Mukesh Pal <[email protected]>; shipra gautam <[email protected]>; Vani Sameera Yerramilli <[email protected]>; Balakrishna Reddy T <[email protected]>; Sayali Pawar <[email protected]>; Sanjana Chandrasekhar <[email protected]>; Nitin Kumar <[email protected]>; Sujit Kumar <[email protected]>; Vasanth Gangadharan <[email protected]>; Punith Raj <[email protected]>; Kaunain Arjuman <[email protected]>; Dhannu Kabra <[email protected]>; ASHOK PADMANABAN <[email protected]>; Shikhar Sharma <[email protected]>; Kondepudi Teja Sri Sai Sivannarayan <[email protected]>; Annavaram Sreevidya <[email protected]>; Niraj Durgapal <[email protected]>; Hrishikesh Singh <[email protected]>; Snehal Kadukatt <[email protected]>; Bajrul Rahman K <[email protected]>; Harish Kumar Ambeer <[email protected]>; Sangeetha Gopinathan <[email protected]>; Rashmi Jha <[email protected]>; Megha Agrawal <[email protected]>; Disha Poojari <[email protected]>; Balachandar Chidambaram <[email protected]>; Prasad Deb <[email protected]>; Sushmitha Swamy <[email protected]>; Shashank Kharche <[email protected]>; Utkarsh Chaudhari <[email protected]>; Shamraj Ravindra <[email protected]>; Saket Suman <[email protected]>; Vishal Palakurthi <[email protected]>; Sandeep Kona <[email protected]>; Pawan Sarswat <[email protected]>; Bijou Bhaskaran <[email protected]>; Sushma S <[email protected]>; Vivek Singh <[email protected]>; Ramesh Giduthuri <[email protected]>; Sweta Bhardwaj <[email protected]>; Sourodeep Banerjee <[email protected]>; Archana P <[email protected]>; Poojitha Naidu <[email protected]>; Naveena Gooty <[email protected]>; Amit Maheshwari <[email protected]>; Hajaran Begum <[email protected]>; Richa Jain <[email protected]>; Mayank Dixit <[email protected]>; Israel Vijay Guthikonda <[email protected]>; Manmohan Mohapatra <[email protected]>; VINAY JILLA <[email protected]>; Deepika Kavdiya <[email protected]>; Abhishek Agarwal <[email protected]>; RAVINDRA NEGI <[email protected]>; Ganesh Wattamwar Wattamwar <[email protected]>; Sukrant Kathuria <[email protected]>; Chandrakant Mishra <[email protected]>; Bhaskar Reddy Maram <[email protected]>; Sravani Atla <[email protected]>; Venkata Satya Kiran Pyla <[email protected]>; Laxmi Deodhar <[email protected]>; Sirisha Kakileti <[email protected]>; Vishal Bajaj <[email protected]>; Sayantan Chowdhury <[email protected]>; Shiva Goel <[email protected]>; Kowshik K <[email protected]>; VIVEKANANDA REDDY <[email protected]>; Md. Fuzail khan <[email protected]>; Sandeep Sappal <[email protected]>; Aayush Pathak <[email protected]>; Viraj Vaibhav <[email protected]>; Dharanian Anandan <[email protected]>; ALAPATI YOMITHA NAGA MYNA <[email protected]>; Ananda Kasukurthi <[email protected]>; Yogesh Dhanorkar <[email protected]>; Kapil Dev <[email protected]>; Akhilesh Singh <[email protected]>; Venkatesh Kadali <[email protected]>; Veerendra Kumar Anantharam <[email protected]>; Lavanya Raghava <[email protected]>; Santhosh Babu Vanaparthi <[email protected]>; Gowthaman V <[email protected]>; Hemalatha Gannavarapu <[email protected]>; Shraavan Kumar RN <[email protected]>; Bhavesh Bhangale <[email protected]>; Mukkavilli Murthy <[email protected]>; Shubham Anand <[email protected]>; Konjeti Venkata Preetham Kumar <[email protected]>; Aashutosh Laxmikant Varma <[email protected]>; Sneha Mishra <[email protected]>; Anant Patil <[email protected]>; Josyula Prasad <[email protected]>; Divya Chhapolika <[email protected]>; Mayukh Banerjee <[email protected]>; Shravan Donthula <[email protected]>; Rahul Khandelwal <[email protected]>; Sukanta Barari <[email protected]>; Bhavesh Jadav <[email protected]>; Rajesh Annamalai <[email protected]>; Srihari Babu Vaskuri <[email protected]>; Praggyashree Roy <[email protected]>; Nithish Nayak <[email protected]>; Hitesh Jasuja <[email protected]>; Pulkit Sachan <[email protected]>; Bhasha Desai <[email protected]>; Vineet Dangwal <[email protected]>; Angshuman Bhattacharjee <[email protected]>; Soumya Mallick <[email protected]>; Vandhana R B <[email protected]>; Sachin Patil <[email protected]>; Umakant Sahu <[email protected]>; Chenchu Sasikumar Kale <[email protected]>; Vasam Harish Kumar Goud <[email protected]>; Satish Noothi <[email protected]>; keerthi KEERTHI PRASANNA <[email protected]>; Shubham Kumar <[email protected]>; Ashwini Menon <[email protected]>; Kriti Gayatri <[email protected]>; Shebin Babu <[email protected]>; SANKAR SOMASUNDARAM <[email protected]>; prabit khumukcham <[email protected]>; Bhaskar Mukherjee <[email protected]>; Manoj Grandhi <[email protected]>; Venkatesh Srinivasan <[email protected]>; Arusha Agrawal <[email protected]>; Bhargav Trivedi <[email protected]>; Prasanna BR <[email protected]>; Sonali Kar <[email protected]>; Venkata Ramesh Reddy Kandukuri <[email protected]>; Karri Vara Lakshmana Reddy <[email protected]>; Lava Somepalli <[email protected]>; Sriram Ganesan <[email protected]>; Shashank Sharma <[email protected]>; Aktarul Haque <[email protected]>; Prajakta Deshpande <[email protected]>; Priyansh Suryawanshi <[email protected]>; Ashutosh Shukla <[email protected]>; Karthik HK <[email protected]>; Yogeshwari A <[email protected]>; Ravishankar Raja <[email protected]>; Priyanka Devkar <[email protected]>; Md Zafar Alam <[email protected]>; jagannath kundu <[email protected]>; Manish Chawla <[email protected]>; Sudhakar Kaluvala <[email protected]>; Debadrita Ghosh <[email protected]>; Dibyo Ghosh Chowdhury <[email protected]>; Viral Abotiyawala <[email protected]>; Jitendra Singh <[email protected]>; Manasa Peethani <[email protected]>; Pallapothu Aneela <[email protected]>; Jayanthi K <[email protected]>; N Baskar Sedupathi <[email protected]>; Swathi Baddam <[email protected]>; Rahul Philip <[email protected]>; Prashant Kumar Tyagi <[email protected]>; Sridivya Pesala <[email protected]>; Thirumani Selvam <[email protected]>; KONDALA RAO YARRAMCHETTY <[email protected]>; SISEENDRI VALLEPU <[email protected]>; Ritika Arya <[email protected]>; Lokesh Gudla <[email protected]>; Ravikumar Vasudevan <[email protected]>; Atish Golechha <[email protected]>; Soumya Goswami <[email protected]>; Manasa Kollipara <[email protected]>; PRIYADHARSHAN P S <[email protected]>; Vinod Nej <[email protected]>; Sirish Vegad <[email protected]>; Shivananda Nayak <[email protected]>; Chandrasekhar Redrouthu <[email protected]>; Ravi CR <[email protected]>; Saurabh Maheshwari <[email protected]>; Sandeep Kumar <[email protected]>; Aditya Singh <[email protected]>; Maruthi Choppara <[email protected]>; Vamsi Kiran Davuluri <[email protected]>`; str.split( ';' ).forEach( e=>{ console.log( e.trim() ) });
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");