jsでサブドメイン名を取得する
jsでサブドメイン名を取得したい場合、↓のようにする。
const parts = location.hostname.split(".");
const subdomain = parts.shift();
// このブログの場合はblog-hello-worldが出力される
console.log(subdomain);
jsでサブドメイン名を取得したい場合、↓のようにする。
const parts = location.hostname.split(".");
const subdomain = parts.shift();
// このブログの場合はblog-hello-worldが出力される
console.log(subdomain);
findIndexを使う
yarn cache clean
仕様書を作る際はexamplesも定義するようにしておきたい