Answer to Question #326251 in HTML/JavaScript Web Application for suresh

Question #326251

"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 person = JSON.parse(readLine().replace(/'/g, '"'));


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


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

}




length is not difined


1
Expert's answer
2022-04-09T17:54:13-0400
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 getCurrentLine = readLine();
    if(!getCurrentLine)
        return;
    ////{"name":"Bob"}
    let person = JSON.parse(getCurrentLine.replace(/'/g, '"'));
    console.log('Person name: ' + person.name);
}

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS