const s = "node.js php python c++ c c# java"
let max = "";
let min = s;
const words = s.split(" ");
for (var i = 0; i < words.length; i++) {
if (words[i].length > max.length)
max = words[i];
if (words[i].length < min.length)
min = words[i];
}
console.log("Largest word: " + max);
console.log("Smallest word: " + min);
/*
run:
Largest word: node.js
Smallest word: c
*/