This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Get thisElementForOutput as the HTML element output.output#output, but check if output.output#output is truthy (truthy) first. | |
| const thisElementForOutput = document.querySelector("output.output#output") ? document.querySelector("output.output#output") : null; | |
| // If thisElementForOutput is not instanceof HTMLOutputElement, throw a TypeError that thisElementForOutput is not a HTMLOutputElement and we expected a HTMLOutputElement. | |
| if (!(thisElementForOutput instanceof HTMLOutputElement)) throw new TypeError(`${thisElementForOutput ? thisElementForOutput : thisElementForOutput} is not a HTMLOutputElement! Expected ${thisElementForOutput ? thisElementForOutput : thisElementForOutput} to be a HTMLOutputElement.`); | |
| // Get thisElementForInput as the HTML element input.input#input, but check if input.input#input is truthy (truthy) first. | |
| const thisElementForInput = document.querySelector("input.input#input[type=text]") ? document.querySelector("input.input#input[type=text]") : null; | |
| // If thisElementForInput is not |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NOT I AUTHOR!!!! | |
| Software engineering principles, from Robert C. Martin's book Clean Code, adapted for JavaScript. This is not a style guide. It's a guide to producing readable, reusable, and refactorable software in JavaScript. | |
| Not every principle herein has to be strictly followed, and even fewer will be universally agreed upon. These are guidelines and nothing more, but they are ones codified over many years of collective experience by the authors of Clean Code. | |
| Our craft of software engineering is just a bit over 50 years old, and we are still learning a lot. When software architecture is as old as architecture itself, maybe then we will have harder rules to follow. For now, let these guidelines serve as a touchstone by which to assess the quality of the JavaScript code that you and your team produce. | |
| One more thing: knowing these won't immediately make you a better software developer, and working with them for many years doesn't mean you won't make mistakes. Every piece of code starts as a first draf |