0325

1. 학습내용

document.write(`<li>${topics[i]}</li>`);
let as = document.querySelectorAll('a');
	for(let i=0; i<as.length; i=i+1){
		as[i].style.color='white';
	}
document.querySelector('input')
document.querySelector('input').click()
let as = document.querySelectorAll('input');
	for(let i=0; i<as.length; i=i+1){
		as[i].click();
	}
함수
<html>
    <body>
        <h1>function</h1>
        <script>
            function abc(){
                console.log('a');
                console.log('b');
                console.log('c');
            }
            abc();
        </script>

        <h1>VAT</h1>
        <script>
            function vatcal(){
                let 가격 = 1000;
                let 부가세율 = 0.1;
                let 부가세 = 가격 * 부가세율;
                console.log(부가세);
            }
            vatcal();
        </script>

        <script>
            function vatcal(cost){
                let ratio = 0.1;
                let vat = cost * ratio;
                console.log(vat);
            }
            vatcal(3000);
        </script>

        <script>
            function vatcal(cost, ratio){
                let vat = cost * ratio;
                console.log(vat);
            }
            vatcal(3000, 0.2);
        </script>
        

        <h1>SUM</h1>
        <script>
            function sum(a, b){
                return a + b;
            }
            alert(sum(100, 200));
        </script>
    </body>
</html>
오브젝트
<html>
    <body>
        <h1>Object</h1>
        <script>
            let student = ['egoing', 'duru']
            console.log(student[0], student[1]);

            let member = {developer:'egoing', designer:'duru'};
            console.log(member.developer, member.designer);

            let person = {name:'egoing', city:'seoul', job:'developer'};
            console.log(person.name, person.city, person.job);

            let MyMath = {}
            MyMath.PI = 3.14;
            MyMath.sum = function(val1, val2){
                return val1+val2;
            }
            console.log(MyMath.PI)
            console.log(MyMath.sum(10,20))
        </script>
    </body>
</html>

2. 어려웠던 점

.

3. 해결방법

.

4. 학습소감

클래스, 함수, 오브젝트부터는 잘 모르는 내용

좋은 웹페이지 즐겨찾기