HTML/JavaScript Web Application Answers

Questions: 680

Answers by our Experts: 648

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

o Explain the architectures used in application integration?

o   Describe interoperability?

o   What are the challenges in application integration that describe the solutions to overcome the challenges?


product of array items

given an array integers, write a JS program to get the product of the given integers in the array

sample input1

[1,2,3]

sample output1

1*2*3 = 6


"use strict";


process.stdin.resume();

process.stdin.setEncoding("utf-8");


let inputString = "";

let currentLine = 0;


process.stdin.on("data", (inputStdin) => {

 inputString += inputStdin;

});


process.stdin.on("end", (_) => {

 inputString = inputString

  .trim()

  .split("\n")

  .map((str) => str.trim());

 main();

});


function readLine() {

 return inputString[currentLine++];

}


function main() {

 let integers = JSON.parse(readLine());


 /* Please do not modify anything above this line */


 /* Write your code here and log the output */

}



Squares of array items

given an array myArray write a JS program to get the squares of each item in the given array


input1

[[1,2],[3,4][5,6]]

output1

[ [1,4],[9,6], [25, 36]]


"use strict";


process.stdin.resume();

process.stdin.setEncoding("utf-8");


let inputString = "";

let currentLine = 0;


process.stdin.on("data", (inputStdin) => {

 inputString += inputStdin;

});


process.stdin.on("end", (_) => {

 inputString = inputString

  .trim()

  .split("\n")

  .map((str) => str.trim());

 main();

});


function readLine() {

 return inputString[currentLine++];

}


function main() {

 let myArray = JSON.parse(readLine());


 /* Please do not modify anything above this line */


 /* Write your code here and log the output */

}



find the first value

given an array myArray of positive integers, write a JS program to find the first smallest integer divisible 2 and 3 Log the number or Undefined.in case no integer is found divisible by 2 and 3


input1

[51,18,15,12]

output1

[12]

input2

[41,29,17,19,31]

output2

undefined


"use strict";


process.stdin.resume();

process.stdin.setEncoding("utf-8");


let inputString = "";

let currentLine = 0;


process.stdin.on("data", (inputStdin) => {

 inputString += inputStdin;

});


process.stdin.on("end", (_) => {

 inputString = inputString

  .trim()

  .split("\n")

  .map((str) => str.trim());

 main();

});


function readLine() {

 return inputString[currentLine++];

}


function main() {

 let myArray = JSON.parse(readLine());


 /* Please do not modify anything above this line */


 /* Write your code here and log the output */

}



Replacing array Item

Given an array myArray, targetItem and a replace item write a JS program to replace the targetItem with the given replacement in myArray consists of more than one targetItem replace the first occurence.


sample input1

[1,2,3,'four'5,6]

'four'

4

sample output1

[1,2,3,4,5,6]


function readLine() {

 return inputString[currentLine++];

}


function main() {

 let myArray = JSON.parse(readLine().replace(/'/g, '"'));

 let targetItem = JSON.parse(readLine().replace(/'/g, '"'));

 let replaceItem = JSON.parse(readLine().replace(/'/g, '"'));


 /* Please do not modify anything above this line */


 /* Write your code here and log the output */

}



concatenate and remove Duplicates

Given two arrays arr1 and arr2 of positive integers write a JS program to concatenate two rows and remove duplicates from the concatenated array. Log the array with unique items in ascending order


input1

[1,4,7,3,7,3,3]

[2,4,5,5,3,2,1]

output1

[1,2,3,4,5,7]


"use strict";


process.stdin.resume();

process.stdin.setEncoding("utf-8");


let inputString = "";

let currentLine = 0;


process.stdin.on("data", (inputStdin) => {

 inputString += inputStdin;

});


process.stdin.on("end", (_) => {

 inputString = inputString

  .trim()

  .split("\n")

  .map((str) => str.trim());

 main();

});


function readLine() {

 return inputString[currentLine++];

}


function main() {

 let arr1 = JSON.parse(readLine());

 let arr2 = JSON.parse(readLine());


 /* Please do not modify anything above this line */


 /* Write your code here and log the output */

}




Common arrays in three arrays

given three arrays arr1,arr2,arr3 write a JS program to find the common items in the among three arrays.

sample input1

[1,2,3,'cat']

[1,'cat',4]

[1,'cat,64]

output1

[1,'cat']

sample input2

['cat','rat','dog']

['lion','fox']

['kiwi','eagle']

output2

[]


function readLine() {

 return inputString[currentLine++];

}


function main() {

 let arr1 = JSON.parse(readLine().replace(/'/g, '"'));

 let arr2 = JSON.parse(readLine().replace(/'/g, '"'));

 let arr3 = JSON.parse(readLine().replace(/'/g, '"'));


 /* Please do not modify anything above this line */


 /* Write your code here */

}


Cumulative Sum

given an array integers, write a JS program to get the cumulative sum of the items in the array


sample input1

[1, 10, 100, 1000]

sample output1

[1, 11, 111, 1111]


"use strict";


process.stdin.resume();

process.stdin.setEncoding("utf-8");


let inputString = "";

let currentLine = 0;


process.stdin.on("data", (inputStdin) => {

 inputString += inputStdin;

});


process.stdin.on("end", (_) => {

 inputString = inputString

  .trim()

  .split("\n")

  .map((str) => str.trim());


 main();

});


function readLine() {

 return inputString[currentLine++];

}


function main() {

 let integers = JSON.parse(readLine());


 /* Please do not modify anything above this line */


 /* Write your code here */

}




Sports Data

write a JS program to consolidate the data so that each student should participate in only one sport if duplicates entries are found consider the latest entry

input1

[['Arjun','Cricket'],['Ronalodo','Football'],['pradeep','Volleyball']

output1

{Arjun: 'Cricket',Ronaldo:'Football',Pradeep:'Volleyball'}


let inputString = "";

let currentLine = 0;


process.stdin.on("data", (inputStdin) => {

 inputString += inputStdin;

});


process.stdin.on("end", (_) => {

 inputString = inputString

  .trim()

  .split("\n")

  .map((str) => str.trim());


 main();

});


function readLine() {

 return inputString[currentLine++];

}


function main() {

 let sportsData = JSON.parse(readLine().replace(/'/g, '"'));


 /* Please do not modify anything above this line */


 /* Write your code here */

}


Date Type Report

given an array myArray write a JS program to find the count of number,object,string,boolean. data values in the array


sample input1

[1, '2', true,{'a':'b'}, false]

sample output1

{number: 1, object:2, string:1, boolean: 2}


"use strict";


process.stdin.resume();

process.stdin.setEncoding("utf-8");


let inputString = "";

let currentLine = 0;


process.stdin.on("data", (inputStdin) => {

 inputString += inputStdin;

});


process.stdin.on("end", (_) => {

 inputString = inputString

  .trim()

  .split("\n")

  .map((str) => str.trim());


 main();

});


function readLine() {

 return inputString[currentLine++];

}


function main() {

 let myArray = JSON.parse(readLine().replace(/'/g, '"'));


 /* Please do not modify anything above this line */


 /* Write your code here */

}



LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS