Skip to content
Advertisement

refactoring my JavaScript code to remove more then just white space

The following code is functional but I would like to refactor the !== part that allows my ternary to run only on values that are not white space so I can include edge case test’s. This would include any non letter value as well as white space and I know that regex may play a part but I can’t find a niftty way to incorporate it into the if() statement that precedes the ternary operations.

JavaScript

Advertisement

Answer

you can also do that…

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement