본문 바로가기

자바스크립트41

별찍기(반복문 연습) 등차수열/등비수열/계차수열 for(let str = 1; str = 1; str -= 1){ console.log("*".repeat(str)); } 별 1씩 감소 -result- *************** undefined for(let str = 5; str >= 1; str -= 1){ console.log(" ".repeat(5 - str) + "*".repeat(str)); } 별 1씩 증가 / 공백 0 부터 1씩 증가 -result- ***** **** *** ** * undefined for(let str = 9; str >= 1; str -= 2){ console.log(" ".repeat((9 - str) / 2) + "*".repeat(str)); } 별 2씩 감소 / 공백 1씩 증가 -result- *****.. 2020. 11. 17.
Flowchart - 순서도(설계) ★Flowchart - 순서도(설계)★ 어떤 일을 처리하는 과정을 간단한 기호와 화살표로 도식화한 그림. 주로 컴퓨터 프로그래밍에서 프로그램이 돌아가는 과정을 그림으로 나타낼 때 사용된다. www.new1cm.com/2018/07/drowio.html www.tcpschool.com/codingmath/flowchart 2020. 11. 17.
자바스크립트에서 연산자 부호 정리(=, ==, === 차이) aboooks.tistory.com/9 2020. 11. 13.
인자, 인수(Argument) vs 매개변수(Parameter)의 차이점. 인자 또는 인수(argument)는 어떤 함수를 호출시에 전달되는 값을 말한다. sum(a: 10, b: 20) 매개변수(parameter)은 그 전달된 인자를 받아들이는 변수이다. func sum(a: Int, b: Int)->Int{ return a+b } 2020. 10. 27.
Object literal (객체 리터럴) webclub.tistory.com/390 const 오브젝트 = { key : value } ← property(key & value) [객체 리터럴 사용방법] OpenWindow라는 함수에 객체 리터럴을 이용해 options 객체를 구성, 함수를 호출하는 데 사용하는 인자를 전달하는 값으로 사용. OpenWindow 함수 내부에서는 인자를 전달받는 options에서 "path", "windowName", "windowOption"속성이 있느지 체크한다. 없다면 각 기본값을 이용하게 된다. 객체 리터럴은 중첩된 표현도 가능하다. 아래는 obj 객체의 parent속성에 다른 객체를 할당하는 코드. [객체 정의] youtu.be/vrhIxBWSJ04 사용자 정의의 객체를 정의하기 위해 자바스크립트에서는 c.. 2020. 9. 16.
Spread Syntax - JavaScript Tutorial 1. Creates copies of object with updated values 2. Collects remaining keys off object destructuring 기존 객체변수를 분해해 변수의 키값인 name, age를 바로 사용할 수 있다. 즉, let name = user.name | let age = user.age와 같은 의미이다. 배열 리터럴에서의 전개 var parts = ['shoulders', 'knees']; var lyrics = ['head', ...parts, 'and', 'toes']; // ["head", "shoulders", "knees", "and", "toes"] 배열을 연결하는 더 나은 방법 var arr1 = [0, 1, 2]; var arr2 = [3.. 2020. 9. 12.