Upgrade to Pro — share decks privately, control downloads, hide ads and more …

es6

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

 es6

Avatar for Kakitaku00

Kakitaku00

June 18, 2020

More Decks by Kakitaku00

Other Decks in Technology

Transcript

  1. &4ͬͯΑ͘ฉ͚͘ͲͳΜͰʁ w ม਺ఆ਺એݴ MFUDPOTU  w Ξϩʔؔ਺ w ςϯϓϨʔτจࣈྻ w

    Ϋϥεߏจ w εϓϨουԋࢉࢠ Ҏલͷ΋ͷ͔Βେ෯ʹվम͕ೖΓɺศརͳػೳ͕ଟ͘௥Ճ͞Εɺ༷ʑͳॲཧΛ ΑΓ؆ܿʹهड़͢Δ͜ͱ͕Ͱ͖ΔΑ͏ʹͳΓɺ+BWB4DSJQUͷ෼ذ఺ͱͳͬͨҝ ͞Βʹ৭ʑʜ ࠓճ͸ม਺એݴΛ۷ΓԼ͛·͢
  2. ม਺એݴWBSMFUͷҧ͍ WBSؔ਺಺Ͱ͋Ε͹Ͳ͜Ͱ΋ࢀরՄೳ MFUJGGPS౳ͷϒϩοΫ಺ \^ ͷΈࢀরՄೳ function differenceScope(variable) { if (variable

    === "var") { var scope = "varͰએݴ͠·ͨ͠"; } if (variable === "lef") { let scope = "letͰએݴ͠·ͨ͠"; } console.log(scope); } differenceScope("var"); // varͰએݴ͠·ͨ͠ differenceScope("let"); // undefined
  3. ఆ਺એݴDPOTU w ஋ͷ࠶୅ೖ͕Ͱ͖ͳ͍ w ม਺͚ͩͷએݴ͸ෆՄ w MFUͱಉ͡ϒϩοΫείʔϓ w ഑ྻͷཁૉɺΦϒδΣΫτͷ஋ͷ௥ Ճɾมߋ͸Մೳ

    // ࠶୅ೖෆՄ const num = 1; num = 3; // Τϥʔ // ม਺એݴ var text1; // ok let text2; // ok const text3; // Τϥʔ // ഑ྻʹཁૉΛ௥Ճ const array = [1, 2, 3] array.push(4) // [1, 2, 3. 4]