sebastian's notebooks

  • Longest Word - /sebastian/longest-word-1
    Last edited 6 years ago
    After this you will be able to write a program that takes a sentence and displays the longest word in that sentence. You will become familiar with: - Strings - Arrays - Numbers - Booleans - Conditionals - Loops Strings are sequences of characters wrapped in quotes. For example, we can create a variable called helloString that contains the words "Hello world!":
  • Longest Word - /sebastian/longest-word-2
    Last edited 6 years ago
    Before going further, there are two more types you need to know. You have already seen the first one a few times: the Number type. Here are a few numbers.
  • Smallest Number - /sebastian/longest-word-hint
    Last edited 7 years ago
    var numbers = [12, -25, 26, 1020]; var smallest = numbers[0]; // assume first number is smallest to begin for (var i = 0; i < numbers.length; i++) { if (numbers[i] < smallest) { smallest = numbers[i]; } } console.log(smallest);