0
Javascript Problem
//Â Write a function that takes a string (a) as argument //Â Extract the first half a //Â Return the result function myFunction(a){ return } What is the question? Can anyone explain me please?.
1 Answer
0
function getSubStr(s){
let pos = parseInt( s.length/2 );
return s.substring(0, pos); // Extract the first half
}
let str = "sololearn";
console.log( getSubStr(str) );