Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- console.log("I'm Ready!");
- var hacker1='Constantinos';
- console.log("The driver\'s name is: " +hacker1);
- var hacker2 = prompt("What's your navigator\'s name");
- console.log("The navigator\'s name is: " +hacker2);
- if (hacker1.length>hacker2.length){
- console.log("The driver has the longest name, it has "+hacker1.length);
- }
- else if(hacker1.length<hacker2.length){
- console.log("The navigator has the longest name, it has "+hacker2.length);
- }
- else {
- console.log('WOW you both got equally long names'+ hacker2.length);
- }
- var upname =''
- for (var i = 0; i < hacker1.length; i++) {
- upname= upname + ' ' + hacker1[i].toUpperCase();
- }
- console.log(upname);
- var rev=''
- for (var x = hacker2.length - 1 ; x>=0 ; x--) {
- rev=rev + hacker2[x];
- }
- console.log(rev);
Add Comment
Please, Sign In to add comment