change-case NPM package includes many text conversion methods for most common cases: camel case, capital case, constant case, dot case, header case, no case, param case, pascal case, path case, sentence case, and snake case. It’s very easy to use, see example:
const changeCase = require('change-case')
const input = 'An_Example string-with.mixed CASES 11.12-2020.. @ #$ %^ & * ('
console.log(changeCase.camelCase(input))
// => anExampleStringWithMixedCases_11_12_2020
console.log(changeCase.capitalCase(input))
// => An Example String With Mixed Cases 11 12 2020
console.log(changeCase.constantCase(input))
// => AN_EXAMPLE_STRING_WITH_MIXED_CASES_11_12_2020
console.log(changeCase.dotCase(input))
// => an.example.string.with.mixed.cases.11.12.2020
console.log(changeCase.headerCase(input))
// => An-Example-String-With-Mixed-Cases-11-12-2020
console.log(changeCase.noCase(input))
// => an example string with mixed cases 11 12 2020
console.log(changeCase.paramCase(input))
// => an-example-string-with-mixed-cases-11-12-2020
console.log(changeCase.pascalCase(input))
// => AnExampleStringWithMixedCases_11_12_2020
console.log(changeCase.pathCase(input))
// => an/example/string/with/mixed/cases/11/12/2020
console.log(changeCase.sentenceCase(input))
// => An example string with mixed cases 11 12 2020
console.log(changeCase.snakeCase(input))
// => an_example_string_with_mixed_cases_11_12_2020
Lodash is my favorite JavaScript library that includes many useful data manipulation utilities in functional programming style. It can run in Node.js and browsers.
The below snippet is an example of using 2 functions filterand includes to find duplications in an array.
Progressive Web App (PWA) is getting very popular these days in 2020 because it provides a greater web experience and responsiveness, especially for interactive application. Part of the power comes from various caching strategies which allow smoother experience during interrupted network and even offline operation (partially or fully depending the type of application of course).
There is a bit of downside though. The cached version might stick around longer than wanted when there is a newer version available. Sometimes a force refresh (F5) might not be effective. Usually it will be eventually updated, but if you want to get the latest update right away, that can be done quite easily as the following example:
In Chrome browser, on the PWA web page, click on the lock icon next to the address to go to Site settings