ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [100DaysOfCode] 30๊ฐ•
    Front-end/100DaysOfCode 2022. 8. 23. 18:43

     

    Hi, JavaScript! ๐Ÿ‘‹

     

     

    ๋ณ€์ˆ˜(variables)

    ๋ฐ์ดํ„ฐ๋ฅผ ๋‹ด๋Š” ๋ฐ•์Šค์— ์ด๋ฆ„์„ ๋ถ™์ธ ๊ฒƒ

    let age = 32;
    age๋ผ๋Š” ๋ฐ•์Šค์— 32 ๊ฐ’์ด ๋“ค์–ด์žˆ๋‹ค

     

    HTML ํŒŒ์ผ์— .js ํŒŒ์ผ ์—ฐ๋™ํ•˜๊ธฐ

    <script src="app.js"></script>
     

    ์‹ค์Šต ์ฝ”๋“œ

    // ํฐ๋”ฐ์˜ดํ‘œ, ์ž‘์€๋”ฐ์˜ดํ‘œ ์ค‘ ๋ฌด์—‡์„ ์จ๋„ ์ƒ๊ด€ ์—†์ง€๋งŒ, ํ•˜๋‚˜๋ฅผ ์ •ํ•˜๋ฉด ์ผ๊ด€๋˜๊ฒŒ ์‚ฌ์šฉํ•ด์•ผ ํ•œ๋‹ค
    // ๋”ฐ์˜ดํ‘œ๋Š” ์‹œ์ž‘๊ณผ ๋์„ ๋ช…์‹œํ•ด์ฃผ๋Š” ์—ญํ• ์„ ํ•˜๊ธฐ ๋•Œ๋ฌธ์—, ๋ฌธ์ž์—ด ์•ˆ์—์„œ ์ถœ๋ ฅํ•ด ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด ์—ญ์Šฌ๋ž˜์‹œ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค
    
    //value
    alert('"์•ˆ๋…•ํ•˜์„ธ์š” ์ €๋Š” ๊น€์—ฐ์ˆ˜์ž…๋‹ˆ๋‹ค"'); //๋‚ด์žฅ๋œ ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ๋ช…๋ ์–ด, alert๋ฅผ ๋ธŒ๋ผ์šฐ์ €์—๊ฒŒ ์ „์†ก
    alert(24);
    
    //variable
    let greeting = "Hi, I'm Bonny๐Ÿฐ";
    alert(greeting);
    
    let age = 24;
    alert(age);
    
    // array[]
    let hobbies = ["Sports", "Cooking", "Reading"];
    alert(hobbies[1]); //index ๋ฒˆํ˜ธ๋กœ ์ ‘๊ทผ
    
    // object(lable: value)
    let job = { title: "developer", location: "Seoul" };

     

    ์‹คํ–‰๊ฒฐ๊ณผ

    'Front-end > 100DaysOfCode' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๋‹ค๋ฅธ ๊ธ€

    [100DaysOfCode] 32๊ฐ•  (0) 2022.09.01
    [100DaysOfCode] 31๊ฐ•  (0) 2022.08.26
    [100DaysOfCode] 27๊ฐ• - 28๊ฐ•  (0) 2022.08.21
    [100DaysOfCode] 26๊ฐ•  (0) 2022.08.18
    [100DaysOfCode] 25๊ฐ•  (0) 2022.08.18
Designed by Tistory.