From 1a9f2f4d8b9d021f3a2f15ad7e7cbfd7487da193 Mon Sep 17 00:00:00 2001 From: Samuel Date: Tue, 22 Oct 2019 14:05:51 +0200 Subject: [PATCH] done --- .DS_Store | Bin 0 -> 6148 bytes basic-algorithms.js | 40 +++++++++++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 hacker2.length){ + console.log(`The Driver has the longest name, it has ${hacker1.length} characters`) + } else if (hacker1.length < hacker2.length){ + console.log(`Yo, navigator got the longest name, it has ${hacker2.length} characters`) + } else {} + console.log(`wow, you both got equally long names, ${hacker2.length} characters!!`) +} + +//loop drivers name + for(let i = 0; i < hacker1.length; i++){ + console.log(`${hacker1[i]}`) + } + + //loops driver name backwards + for(let i = hacker.length; i > 0; i--){ + console.log(`${hacker1[i]}`) + } + + + +//loop on first letter.. + for(let i = 0; i < 1; i++){ + if (hacker1[0] === "a"){ + console.log(`The driver's name goes first`) + } else if (hacker2[0] === "a"){ + console.log(`Yo, the navigator goes first definitely`) + } else {} + console.log(`What?! You both got the same name?`) + } \ No newline at end of file