Examine the distinctions between the 'var' and 'let' keywords in JavaScript, focusing on scope and hoisting to write cleaner code.