nosdav / bookmarks

nosdav bookmarks
https://nosdav.github.io/bookmarks/
MIT License
4 stars 1 forks source link

Refactor getQueryStringValue function using ES6 syntax and arrow functions #2

Closed melvincarvalho closed 1 year ago

melvincarvalho commented 1 year ago

Issue Description: The current implementation of the getQueryStringValue function can be improved by adopting a more modern syntax using ES6 features and arrow functions. This refactoring aims to make the code more concise and easier to read.

Proposed Changes:

const getQueryStringValue = key => {
  const queryParams = new URLSearchParams(window.location.search.substring(1));
  return queryParams.get(key);
};

Benefits: