Bhaj's Crossword Helper explainer

Aim of the puzzle: Find the key information in a word problem and solve the problem using code.
Walk through of solution: Bhaj wants a function that takes a word and returns the last letter of the word.

Start the puzzle by adding a parameter to the lastLetter() function. Give it a name like word or something similar.

Create a local variable inside the function to store the last index value, for example: let lastIndex = word.length - 1.

Then, use this variable to return the last letter of the word, for example: return word[lastIndex]
Sample code solution:

import { randomWord } from 'cross.words';

function lastLetter(word) {
    let lastIndex = word.length - 1;
    return word[lastIndex];
}

console.log(randomWord);
console.log(lastLetter(randomWord));

Javascript Concepts: Functions, .length, Strings, Variables