2 ms·
A trick I use to make the JS code more maintainable is to wrap code into pure functions that returns an element. For example if you need an input that only acce
by z3t4 7y ago
A trick I use to make the JS code more maintainable is to wrap code into pure functions that returns an element. For example if you need an input that only accept numbers: var input = makeInputThatOnlyAcceptNumbers() where the function returns the element, and all nitty gritty state handling is done inside the function.