" と ' の使い分けがわかりません

どちらを使っても問題ありません。
2021年8月2日
ユーザー

本来、

btn.textContent = ’凶’;

とすべき所を間違えて 

btn.textContent = "凶";

と、マークアップしている事に気づきました。
確認してみると全ての'を、全て"と記述していました。
"だろうと'だろうと、どちらも同じに動いていたので気づきませんでした。

結果は同じなのに"'の使い分けが分かりません...

    // const results = ["大吉", "中吉", "凶", "末吉"];
    // const n = Math.floor(Math.random() * results.length);
    // btn.textContent = results[n];

    const n = Math.random();
    if (n < 0.05) {
      btn.textContent = "凶";
    } else if (n < 0.2) {
      btn.textContent = "中吉";
    } else {
      btn.textContent = "大吉";

この回答を見るにはプレミアムプランへの登録が必要です

プレミアムプランとは?