목록web (86)
Rainbow
연산자와 피연산자 구별하기 currentYear - birthYear + 1 - currentYear, birthYear, 1 은 피연산자 라고 합니다. - 그외 더히기 빼기는 연산자 라고 합니다. 증감 연산자 이해하기 - 증감 연산자는 피연산자 값을 1만큼 증가 시키거나 감소 시킵니다. var a = 10; var b = a++ + 5; b 15 var c = 10; var d = ++c + 5; d 16 - 위 예시를 보면 증감 연산자는 피연산자 뒤에 있을 때 수식의 처리가 끝난 다음 적용된다. - 반대로 피연산자 앞에 있을 때는 수식을 처리하기 전에 적용된다. - a++은 a(10)와 5를 더하여 b에 할당한 다음에 1만큼 증가 시킨다 - ++c는 c(10) 1만큼 증가 시키고 5를 더해서 d에 할..
수식으로 알아보는 상수와 변수 나이 = 올해연도 - 태어난연도 + 1 언제든 값이 변하므로 변수 항상 값이 일정하다 상수 변수 : 나머지 값은 변할 수 있는 값 입니다. 상수 : 수식의 맨 끝에 있는 숫자 1은 변하지 않는 값 입니다. 변수를 선언하는 규칙 세가지 - 이름은 의미있게 짓는다 - 여러 단어를 연결한 변수 이름은 낙타 모양으로 만들어 준다(낙타 표기법) - 선언할 수 없는 이름도 있다(문자, 밑줄, 달러, 기호, 숫자를 사용할 수 있다) 낙타 표기법 : 첫 번째 단어는 소문자로, 두 번째 단어는 대문자로 시작한다. 변수에 값이나 식 저장하기 - 변수를 선언하면서 값을 저장 - 변수를 선언한 다음에 값을 저장 나이 계산 프로그램 만들기 예시문제;) - age에 저장된 값이 크롬 브라우저에 나타..
크롬 브라우저 콘솔 : 자바스크립트 소스를 간편하게 연습할 수 있는 도구 실무에서 많이 사용된다 크롬 브라우저 콘솔 실행 단축키 : ctrl+shif+j를 누르면 화면 아래에 콘솔창이 나타난다. 사용자 입력값 받기 prompt()함수 prompt() : 사용자가 값을 입력하면 입력 받을 수 있는 대화상자 알림창으로 출력하기 alert() alert() : 웹 브라우저에 알림창이 나타나면서 괄호 안에 있는 내용을 알림창에 표시에 줍니다. 웹 브라우저 화면에 출력하기 document.write() document.write() : 즉 결과값을 크롬 브라우저에 출력하는 용도로 사용한다. (웹 문서 괄호 안의 내용을 쓰는 함수)
객체(object) : 상태(속성)와 행동(메소드)을 함께 가리키는 단위 입니다. ex) 예를 들어 윈도우창 객체인데 높이, 넓이의 상태(속성)를 가지고 있고 새 창을 열거나 행동(메소드)을 가질 수 있습니다.
javascript - 자바스크립트로 작성한 코드는 웹 브라우저에서 실행 결과를 즉시 확인할 수 있다 - 웹 개발뿐 아니라 다양한 용도의 프로그램을 만들 수 있다 - 자바스크립트 공개 API를 사용할 수 있다 - 다양한 라이브러리와 프레임워크를 사용할 수 있습니다 API란? - 어떤 정보를 다른사람이 손쉽게 가져갈 수 있도록 미리 준비한 체계 ex) 예를 들어 기상청에서 만든 API 정보를 이용하면 기상청의 날씨 정보를 손쉽게 얻을 수 있습니다 라이브러리 - 자바스크립트로 미리 구현해 놓은 기능을 묶어 놓은 것 자바스크립트 프레임워크 - 제공된 소스를 수정하거나 추가해서 만들 수 있게 준비한 일종의 틀 자바스크립트 소스 코드 querySelector() - JS 를 사용하다 보면 html의 클래스 이름 ..