substr -> slice

This commit is contained in:
Michael C
2022-01-26 17:54:35 -05:00
parent f555a8e7bb
commit 193374db30
2 changed files with 2 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ async function init() {
// selected tab
if (location.hash != "") {
const substr = location.hash.substring(1);
const substr = location.hash.slice(1);
let menuItem = document.querySelector(`[data-for='${substr}']`);
if (menuItem == null)
menuItem = document.querySelector(`[data-for='behavior']`);

View File

@@ -43,7 +43,7 @@ function findValidElementFromGenerator<T>(objects: T[] | NodeListOf<HTMLElement>
}
export function getHashParams(): Record<string, unknown> {
const windowHash = window.location.hash.substr(1);
const windowHash = window.location.hash.slice(1);
if (windowHash) {
const params: Record<string, unknown> = windowHash.split('&').reduce((acc, param) => {
const [key, value] = param.split('=');