const str = "c# c node.js php c++ python go";
const halfstr = str.substring(0, (parseInt(str.length / 2) + 1));
const center = halfstr.lastIndexOf(' ') + 1;
const parts = [str.substring(0, center), str.substring(center)];
console.log(parts[0]);
console.log(parts[1]);
/*
run:
c# c node.js
php c++ python go
*/