<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.0">Jekyll</generator><link href="https://taehyunn.github.io//feed.xml" rel="self" type="application/atom+xml" /><link href="https://taehyunn.github.io//" rel="alternate" type="text/html" /><updated>2022-03-18T08:57:50+00:00</updated><id>https://taehyunn.github.io//feed.xml</id><title type="html">개발이 재밌는 개발자 Blog</title><subtitle>Tech vlog  </subtitle><author><name>Xogus Cho</name><email>xogus998@naver.com</email></author><entry><title type="html">Next.js</title><link href="https://taehyunn.github.io//Next.js/" rel="alternate" type="text/html" title="Next.js" /><published>2022-02-24T00:00:00+00:00</published><updated>2022-02-24T00:00:00+00:00</updated><id>https://taehyunn.github.io//Next.js</id><content type="html" xml:base="https://taehyunn.github.io//Next.js/"></content><author><name>Xogus Cho</name><email>xogus998@naver.com</email></author><summary type="html"></summary></entry><entry><title type="html">React 학습</title><link href="https://taehyunn.github.io//React/" rel="alternate" type="text/html" title="React 학습" /><published>2022-01-05T00:00:00+00:00</published><updated>2022-01-05T00:00:00+00:00</updated><id>https://taehyunn.github.io//React</id><content type="html" xml:base="https://taehyunn.github.io//React/">&lt;h1 id=&quot;react&quot;&gt;React&lt;/h1&gt;

&lt;p&gt;https://slides.com/woongjae/react2021 (수업자료 Link)&lt;/p&gt;

&lt;p&gt;1)React Getting Started&lt;/p&gt;

&lt;p&gt;1-1)React Concept&lt;/p&gt;

&lt;p&gt;Component Based Development&lt;/p&gt;

&lt;p&gt;Virtual DOM = 화면에 있는 DOM을 직접 다루지않고 DOM을 다루는일을 리액트에게 위임한다.&lt;/p&gt;

&lt;p&gt;라이브러리를 지원한다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220105020900786.png&quot; alt=&quot;image-20220105020900786&quot; /&gt;&lt;/p&gt;

&lt;p&gt;CSR(Client Side Rendering) :&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220105021526220.png&quot; alt=&quot;image-20220105021526220&quot; /&gt;&lt;/p&gt;

&lt;p&gt;개발환경 체크&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Node.js
    &lt;ul&gt;
      &lt;li&gt;installer&lt;/li&gt;
      &lt;li&gt;nvm(노드버전매니저) : 노드의 버전을 변경할 수 있다.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;ex) nvm install 14.16.1&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;//리액트 컴포넌트 -&amp;gt; HTMLElement 연결하기

=&amp;gt; import ReactDOM from 'react-dom';\

//리액트 컴포넌트 만들기

=&amp;gt;import React from 'react';
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;ReactDOM.render : 시작함수. html을 그려!! 라고 생각하면 된다.( main 이라고 생각하면된다.)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220105194900887.png&quot; alt=&quot;image-20220105194900887&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;CDN을 통한 리액트 라이브러리 사용&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;바탕화면 폴더생성. -&amp;gt; 해당 폴더로 이동(cd) -&amp;gt; npm init -y -&amp;gt; 이폴더를 파일서버처럼 운영할수있는&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;npx serve 실행-&lt;/strong&gt;&amp;gt;&lt;/p&gt;

&lt;p&gt;실제 배포시에는 production cdn을 가져와서 넣어야함.&lt;/p&gt;

&lt;p&gt;개인개발용으로는 development cdn을 가져와서 html에 넣는다&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;const Component = props =&amp;gt; {&lt;/p&gt;

&lt;p&gt;​	return React.createElement(‘p’, p태그의 클래스 입력내용, p태그 안에 들어갈내용) //리턴될 떄 리액트엘리먼트로 되어야 한다.&lt;/p&gt;

&lt;p&gt;} // 외부에서 props로받은 값을 사용한다. props.message 같은 형식으로 왜냐. 객체니까&lt;/p&gt;

&lt;p&gt;ReactDOM.render(리액트 컴포넌트 , 리액트 컴포넌트가 그려질 곳 )&lt;/p&gt;

&lt;p&gt;ReactDOM.render( React.createElement (Component, {message:init,count:0} ,  null) , 쿼리셀렉터 루트)&lt;/p&gt;

&lt;p&gt;// 두번쨰는 실제 props에 넣어줄 인자&lt;/p&gt;

&lt;p&gt;훅(Hooks) (리액트 컴포넌트 만드는 방법은 총2가지뿐이다.)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220105203703918.png&quot; alt=&quot;image-20220105203703918&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;import React from 'react';
//정의 1번 방법
function FunctionComponent() {
	return &amp;lt;div&amp;gt;Hello&amp;lt;/div&amp;gt;; // 필수로 써야함.
}
//사용
ReactDOM.render(&amp;lt;FunctionComponent/&amp;gt;, document.querySelectot(#root))

//정의 2번 방법
const FunctionComponent = () =&amp;gt; &amp;lt;div&amp;gt;Hello&amp;lt;/div&amp;gt;;
//사용
ReactDOM.render(&amp;lt;FunctionComponent/&amp;gt;, document.querySelectot(#root))
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220105204636011.png&quot; alt=&quot;image-20220105204636011&quot; /&gt;&lt;/p&gt;

&lt;p&gt;▶ 결과&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220105204703704.png&quot; alt=&quot;image-20220105204703704&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;body&amp;gt;
    &amp;lt;div id=&quot;root&quot;&amp;gt;&amp;lt;/div&amp;gt;


    &amp;lt;script crossorigin src=&quot;https://unpkg.com/react@17/umd/react.development.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;script crossorigin src=&quot;https://unpkg.com/react-dom@17/umd/react-dom.development.js&quot;&amp;gt;&amp;lt;/script&amp;gt;
    &amp;lt;!-- 위에 선언을 통해 React와 ReactDOM 을 가져온것 --&amp;gt;
    &amp;lt;script type=&quot;text/javascript&quot;&amp;gt;
        console.log(React);
        console.log(ReactDOM);

        
    // React.createElement(
    //     type, // 태그 이름 문자열 , 리액트 컴포넌트 , React.Fragment
    //     [props], // 리액트 컴포넌트에 넣어주는 데이터 객체
    //     [...children] // 자식으로 넣어주는 요소들
    // )

    //1.태그 이름 문자열 type
    // ReactDOM.render(
    //     React.createElement('h1', null, `type이 &quot;태그 이름 문자열&quot; 입니다.`),
    //     document.querySelector(&quot;#root&quot;)
    // )

    //2. 리액트 컴포넌트 type
    // const Component = () =&amp;gt; {
    //     return React.createElement('p', null, `type이 &quot;React 컴포넌트&quot; 입니다`)
    // }
    
    // //&amp;lt;Component&amp;gt;&amp;lt;/Component&amp;gt; =&amp;gt; &amp;lt;Component/&amp;gt; =&amp;gt; &amp;lt;p&amp;gt;type이 &quot;React 컴포넌트&quot; 입니다/p&amp;gt;
    // ReactDOM.render(
    //     React.createElement(Component, null, null),
    //     document.querySelector(&quot;#root&quot;)
    // );

    //3.React.Fragment =&amp;gt; tag가 없이 내용만 출력이 된다.
    ReactDOM.render(
        React.createElement(
            React.Fragment,
            null,
            `type이 &quot;React Fragment&quot; 입니다.`
        ),
        document.querySelector(&quot;#root&quot;)
    )
    &amp;lt;/script&amp;gt; 


&amp;lt;/body&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;jsx&quot;&gt;JSX&lt;/h3&gt;

&lt;p&gt;babel =&amp;gt; 최신기술을 구버전에서 사용할 수 있게끔 구현을 시켜줄 때 사용한다.&lt;/p&gt;

&lt;p&gt;JSX 문법으로 작성된 코드는 순수한 JavaScript 로 컴파일 하여 사용한다.&lt;/p&gt;

&lt;p&gt;누가 해주나요??  =? babel&lt;/p&gt;

&lt;p&gt;(baveljs.io 사이트 가면 간단하 확인이 가능하다)&lt;/p&gt;

&lt;p&gt;위 사이트에서 Setup 으로 이동한다음 prototyping 클릭해서 Usage의 cdn을 추가하면&lt;/p&gt;

&lt;p&gt;작동을시켜준다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220105213039944.png&quot; alt=&quot;image-20220105213039944&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220105213209945.png&quot; alt=&quot;image-20220105213209945&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220105213236000.png&quot; alt=&quot;image-20220105213236000&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220105214249511.png&quot; alt=&quot;image-20220105214249511&quot; /&gt;&lt;/p&gt;

&lt;p&gt;ClassComponent 에서 state를 정의하는 방법.&lt;/p&gt;

&lt;p&gt;항상 state 는 객체여야함&lt;/p&gt;

&lt;p&gt;Eevent Handling&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;camelCase 로만 사용 할 수 있으며 , onClick 과 같이 on을 붙여줘야한다&lt;/li&gt;
  &lt;li&gt;이벤트 ={함수}와 같이 쓴다.&lt;/li&gt;
  &lt;li&gt;실제 DOM 요소들에만 사요 ㅇ가능하다.&lt;/li&gt;
  &lt;li&gt;리액트 컴포넌트에 사용하면, 그냥 props로 전달한다.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;render = 웹브라우저에 처음 그려지기 시작&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;리액트 컴포넌트 라이프사이클.&lt;/strong&gt; (v16.3 이전의 라이프사이클 훅이다. 17버전은 달라짐)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220106132527944.png&quot; alt=&quot;image-20220106132527944&quot; /&gt;&lt;/p&gt;

&lt;p&gt;마운트 = render(최초 랜더)&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;v16.3 이후의 컴포넌트 라이프사이클&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220106135251139.png&quot; alt=&quot;image-20220106135251139&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Creating React Project&lt;/p&gt;

&lt;p&gt;https://create-react-app.dev (CRA)&lt;/p&gt;

&lt;p&gt;리액트 애플리케이션을 만드는 것과 관련된 사이트.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npx create-react-app&lt;/code&gt; 프로젝트 명 =&amp;gt; 프로젝트 생성어,&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd 프로젝트명&lt;/code&gt;,&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm start&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;작업을 끝냈을때 배포할 준비를 해야한다 그럴 때&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm run build&lt;/code&gt;를 사용 : 우리가 작업한 소스코드들을 최적화 해준다.&lt;/p&gt;

&lt;p&gt;빌드된 프로덕션용 파일들을 어떻게 실행하냐? npm install -s build`를 리액트 애플리케이션용 파일 서버로 활용이 된다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220106153833741.png&quot; alt=&quot;image-20220106153833741&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;husky&lt;/p&gt;

&lt;p&gt;커밋 후 깃으로 푸쉬하기전에 어떤걸 하고싶다!! 할 때 사용&lt;/p&gt;

&lt;p&gt;git init으로 폴더를 연결시켜주고,&lt;/p&gt;

&lt;p&gt;tic-tac-toe 프로젝트에 npm i husky -D,&lt;/p&gt;

&lt;p&gt;package.json에 “scripts”부분에 “prepare”: “husky install”을 설정해준다. 나중에 다시 패키지를 다른데서 설치해서 사용할때도 prepare을 돌면서 깃훅이 활성화 될것이다.&lt;/p&gt;

&lt;p&gt;설치 후 허스키의 깃훅을 활성화 시키기 위해 npx husky install,&lt;/p&gt;

&lt;p&gt;npx husky add .husky/pre-commit “lint-staged”로 파일 생성,&lt;/p&gt;

&lt;p&gt;npm i lint-staged -D 설치 후 ,&lt;/p&gt;

&lt;p&gt;lint-staged 설정을 해준다 package.json파일에&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&quot;lint-staged&quot;: {
	&quot;**/*.js&quot;:[
		&quot;eslint --fix&quot;,
		&quot;pretter --write&quot;
		&quot;git add&quot;
	] //어떤 폴더에 있던지간에 .js 확장자를 가진 파일을 해주겟다.
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;npm i prettier -D 설치 역시 해주고 Format On save 는 꺼주어야 한다.&lt;/p&gt;

&lt;p&gt;pre-commit 파일 안의 lint-staged 내용을 npx lint-staged 로 바꿔줘야함.이유는 어떤 명령어인지 모르기 때문.&lt;/p&gt;

&lt;p&gt;lint-staged : 커밋하려는 파일에 린터를 돌리고 싶을때 사용&lt;/p&gt;

&lt;p&gt;팀에서 코드를 맞추고 푸쉬하기전에 강제로 맞추는 용도로 많은 팀이 사용하고 있다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220106164541026.png&quot; alt=&quot;image-20220106164541026&quot; /&gt;&lt;/p&gt;

&lt;p&gt;어떤 컴포넌트를 브라우저에 보여줄지에 대한 로직 = React Router&lt;/p&gt;

&lt;p&gt;설치 방법 : npm i react-router-dom&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;cra에 기본 내장된 패키지가 아니다.&lt;/li&gt;
  &lt;li&gt;react-router-dom은 Facebook의 공식 패키지가 아니다.&lt;/li&gt;
  &lt;li&gt;가장 대표적인 라우팅 패키지이다&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;순서대로
`npx create-react-app react-router-example`
`cd react-router-example`
`npm i react-router-dom`
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;src의 폴더를 만들고 거기에 .jsx 파일 3개를 만든다 그 후&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ex)
xport default function Home() {
	return &amp;lt;div&amp;gt;Home 페이지 입니다.&amp;lt;/div&amp;gt;
}
export default function profile() {
	return &amp;lt;div&amp;gt;profile 페이지 입니다.&amp;lt;/div&amp;gt;
}
export default function about() {
	return &amp;lt;div&amp;gt;about 페이지 입니다.&amp;lt;/div&amp;gt;
}

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220106165742639.png&quot; alt=&quot;image-20220106165742639&quot; /&gt;&lt;/p&gt;

&lt;p&gt;동적 라우팅&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220107133949516.png&quot; alt=&quot;image-20220107133949516&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;노태환 강사 2022-01-06&lt;/p&gt;

&lt;p&gt;구현 환경 : codesandbox.io&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;별도 환경설정 필요없이 코딩 가능, 쉬운 코드 공유&lt;/li&gt;
  &lt;li&gt;무료요금제(모든코드가 외부에 공유됨)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Modern JavaScript 튜토리얼 -&amp;gt; 공부하기 추천&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;Switch 와 NotFound&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220107131803834.png&quot; alt=&quot;image-20220107131803834&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220107131855385.png&quot; alt=&quot;image-20220107131855385&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Switch문안에 넣어주면 맞을경우에만 해당하는 곳에 들어간다.&lt;/p&gt;

&lt;p&gt;Home부분은 exact부분이여야한다. 이유는 나머지위에서 맞지않는경우 루트경로인 Home으로 들어가게된다&lt;/p&gt;

&lt;p&gt;exact를 빼게되면 모든경로는 루트경로를 갖게된다.&lt;/p&gt;

&lt;p&gt;JSX 링크로 라우팅 이동하기&lt;/p&gt;

&lt;p&gt;a태그로 리액트에서 이동하게 될 경우 문제가 발생한다.&lt;/p&gt;

&lt;p&gt;브라우저의 특정 새 경로를 입력해주는 것과 다를바없기 때문에 아래 특징과 맞지 않다.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;React-Routing의 특징

서버에서 다른페이지를 새로 가져오는게 아니라 리액트애플리케이션 내부에있는 이 경로에 맞는 다른페이지를 보여주는 용도로만 라우팅 처리가 된다.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Link 컴포넌트를 사용한다!!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220107134754825.png&quot; alt=&quot;image-20220107134754825&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220107134820211.png&quot; alt=&quot;image-20220107134820211&quot; /&gt;&lt;/p&gt;

&lt;p&gt;NavLink 경로가 매칭이되어 맞는다 판단된다면, 스타일 지정을 해준다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220107135047021.png&quot; alt=&quot;image-20220107135047021&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220107141431321.png&quot; alt=&quot;image-20220107141431321&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Styled Components 라이브러리&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i styled component&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;class 를 지정하지않았는데도 추가가 된다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220107172636050.png&quot; alt=&quot;image-20220107172636050&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Styled Components 에서도 전역으로 css 속성을 적용시킬수 있다.&lt;/p&gt;

&lt;p&gt;const GlobalStyle = createGlobalStyle``&lt;/p&gt;

&lt;p&gt;``안에는 스타일을 넣어주는 곳이다.&lt;/p&gt;

&lt;p&gt;import styled, {createGlobalStyled} from “styled-components”;를 해서 가져온다&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;React Shadow&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;본래의 html안에 영향을 주지않는 html이 있다고 생각하면 편하다.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i react-shadow&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Ant Design&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i antd&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;index.js 의 importt “./index.css” 위에 impot “ antd/dist/antd.css”를 추가해줘야 antd 를 먼저 적용후 우리걸 적용하는 방식으로 할 수 있다.&lt;/p&gt;

&lt;p&gt;사이트 : ant.design&lt;/p&gt;

&lt;p&gt;어떤 컴포넌트를 넣으면  그 모습으로 나온다.&lt;/p&gt;

&lt;p&gt;Icon 패키지는 =&amp;gt;  또 다른걸 설치해줘야한다  사이트참조! !&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;HOC ; Higher-Order Components&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;최근에는 중요도가 낮아짐.&lt;/p&gt;

&lt;p&gt;이와 비슷한 역할을 하는 Hook이 나왔기 때문에 사용량이 줄어드는 추세.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220110135558849.png&quot; alt=&quot;image-20220110135558849&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Basic Hooks&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;useState&lt;/code&gt;,  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;useEffect&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;useState를 사용하는 이유.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220110164045979.png&quot; alt=&quot;image-20220110164045979&quot; /&gt;&lt;/p&gt;

&lt;p&gt;useReducer :&lt;/p&gt;

&lt;p&gt;=&amp;gt; 다수의 하윗값을 포함하는 복잡한 정적 로직을 만드는 경우 사용&lt;/p&gt;

&lt;p&gt;=&amp;gt; 다음 state가 이전 state에 의존적인경우&lt;/p&gt;

&lt;p&gt;ex)&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;const [state, dispatch]=useReducer(reducer, {count: 0});
//

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;컴포넌트간 통신&lt;/p&gt;

&lt;p&gt;상위컴포넌트와 하위컴포넌트 의 2가지 방식으로 가능.&lt;/p&gt;

&lt;p&gt;중간의 props로 데이터를 전달해주는 컴포넌트들은 관리하는데 있어 주의해야한다.&lt;/p&gt;

&lt;p&gt;이러한 것들을 해결하기위해 제안되는 방식을 학습해본다.&lt;/p&gt;

&lt;p&gt;해결방안 : Context Api 를 통해 해보자.&lt;/p&gt;

&lt;p&gt;데이터를 Set하기&lt;/p&gt;

&lt;p&gt;1.context를 생성한다.&lt;/p&gt;

&lt;p&gt;2.context.프로바이더를 사용한다&lt;/p&gt;

&lt;p&gt;3.value를 사용한다&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;import React from 'react'

const 이름 = React.creatContext();
export default 이름

하고 index.js 에서는
&amp;lt;이름.Provider value={}/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;jest&lt;/p&gt;

&lt;p&gt;폴더만들기 -&amp;gt; 폴더경로이동-&amp;gt;npm init -y (npm 프로젝트로 만들기)-&amp;gt; npm i jest -D&lt;/p&gt;

&lt;p&gt;package.json&lt;/p&gt;

&lt;p&gt;“scripts” 부분에&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220111152750941.png&quot; alt=&quot;image-20220111152750941&quot; /&gt;&lt;/p&gt;

&lt;p&gt;클래스컴포넌트는 16.8.0 부터 hook을 주로 쓰기때문에 잘 안쓴다&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;test('adds 1+2 to equal 3', () =&amp;gt; {
	expect(1+2).toBe(3)
})
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220112125940687.png&quot; alt=&quot;image-20220112125940687&quot; /&gt;&lt;/p&gt;

&lt;p&gt;test 코드를 분야별로 묶는거 describe(‘’, () =&amp;gt; {});&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220112130506256.png&quot; alt=&quot;image-20220112130506256&quot; /&gt;&lt;/p&gt;

&lt;p&gt;npx jest –watchAll : 항상 테스트가 켜져있는 상태가 된다 일일히 npm test 안해도됨&lt;/p&gt;

&lt;p&gt;jest 는 기본으로 깔려있음. 별도의 패키지 설치 필요 x&lt;/p&gt;

&lt;p&gt;그 후 a 를 누르면 app.test.js 를 test할 준비가 된다.&lt;/p&gt;

&lt;p&gt;React Advanced&lt;/p&gt;

&lt;p&gt;1.Optimizing performance : 필요할때만 렌더한다.&lt;/p&gt;

&lt;p&gt;현업 추가 팁: redux toolkit으로 쓰면 더 쉽고 거기에 타입스크립트로  쓰면 큰 프로젝트 스케일링하기도 편합니다.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;리덕스 미들웨어&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;action이 dispatch 된 다음, reducer에서 해당 action을 받아와서 update하기 전에 추가적인 작업 가능&lt;/li&gt;
  &lt;li&gt;주로 비동디 작업을 처리할 때 사용됨&lt;/li&gt;
  &lt;li&gt;redux-thunk, redux-saga를 많이 사용한다.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;redux-thunk :&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220118190010378.png&quot; alt=&quot;---&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i redux-thunk&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;미들웨어는 함수이다.&lt;/p&gt;

&lt;p&gt;import thunk from “redux-thunk”&lt;/p&gt;

&lt;p&gt;Ducks Pattern : redux를 이러한 패턴으로 작성하니 좋다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220118191158997.png&quot; alt=&quot;image-20220118191158997&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i react-router-dom&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i connected-react-router&lt;/code&gt; : router 를 redux로 관리하고 싶을떄 쓴다&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;redux actions&lt;/p&gt;

&lt;p&gt;=&amp;gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt; npm i redux-actions&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
import { createAction } from &quot;redux-actions&quot;;

console.log(createAction(&quot;Hello&quot;)(&quot;안녕하세요&quot;));
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220118200626911.png&quot; alt=&quot;image-20220118200626911&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;따라서 , createAction 을 수행한 결과무이 액션 생성 함수가 된다.!&lt;/strong&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;redux-saga&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i redux-saga&lt;/code&gt;&lt;/p&gt;

&lt;h3 id=&quot;react로-나의-책장-만들기&quot;&gt;React로 나의 책장 만들기&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npx create-react-app my-books -- template typescript &lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i react-error-boundary&lt;/code&gt; : componentDidCatch 만약 런타임 시 에러가 발생하게되면 에러페이지로 FallBack시켜준다.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;nextjs&quot;&gt;Next.js&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Next.js&lt;/strong&gt;는 &lt;strong&gt;React&lt;/strong&gt; 어플리케이션의 서버사이드렌더링(SSR)을 쉽게 구현할 수 있게 도와주는 프레임워크입니다.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;nextjs&lt;/strong&gt;프로젝트의 기본적인 세팅을 간편하게 시작하는 방법은 &lt;strong&gt;create-next-app&lt;/strong&gt;을 사용하는 것입니다.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;react / react-dom / next&lt;/strong&gt; 가 함께 설치되며, 간편하게 프로젝트 구조를 잡을 수 있습니다.&lt;/p&gt;

&lt;h3 id=&quot;환경-설정-하기&quot;&gt;&lt;strong&gt;환경 설정 하기&lt;/strong&gt;&lt;/h3&gt;

&lt;h4 id=&quot;시스템-요구사항&quot;&gt;&lt;strong&gt;시스템 요구사항&lt;/strong&gt;&lt;/h4&gt;

&lt;p&gt;- Node.js 10.13 or later&lt;/p&gt;

&lt;p&gt;- MacOs, Windows (including WSL), and Linux are supported&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Node.js&lt;/strong&gt; : 자바스크립트 런타임&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NPM&lt;/strong&gt; : 패키지 매니저 도구&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Yarn&lt;/strong&gt; : 개선된 버전의 NPM&lt;/p&gt;

&lt;p&gt;기본적으로 Node.js, NPM or Yarn 이 설치되어 있어야 하고, 편집기로는 VSCode를 사용하도록 하겠습니다.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;npx create-next-app [프로젝트 명]&lt;/li&gt;
  &lt;li&gt;index.js 가 메인 페이지이다.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&quot;리덕스는-언제-쓰는게-좋을까&quot;&gt;리덕스는 언제 쓰는게 좋을까?&lt;/h2&gt;

&lt;p&gt;그렇다면 리덕스는 언제 쓰는게 좋을까? 이 질문에 대한 답은 &lt;a href=&quot;https://redux.js.org/faq/general#when-should-i-use-redux&quot;&gt;리덕스의 공식문서&lt;/a&gt;에 나와있다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;앱의 여러 위치에서 필요한 많은 양의 상태들이 존재할 때 (전역 상태가 필요하다고 느껴질 때)&lt;/li&gt;
  &lt;li&gt;상태들이 자주 업데이트 될 때&lt;/li&gt;
  &lt;li&gt;상태를 업데이트 하는 로직이 복잡할 때&lt;/li&gt;
  &lt;li&gt;앱이 중간 또는 큰 사이즈의 코드를 갖고 있고 많은 사람들에 의해 코드가 관리될 때&lt;/li&gt;
  &lt;li&gt;상태가 업데이트되는 시점을 관찰할 필요가 있을 때&lt;/li&gt;
&lt;/ul&gt;</content><author><name>Xogus Cho</name><email>xogus998@naver.com</email></author><summary type="html">React</summary></entry><entry><title type="html">Vue</title><link href="https://taehyunn.github.io//Vue-First/" rel="alternate" type="text/html" title="Vue" /><published>2022-01-01T00:00:00+00:00</published><updated>2022-01-01T00:00:00+00:00</updated><id>https://taehyunn.github.io//Vue-First</id><content type="html" xml:base="https://taehyunn.github.io//Vue-First/">&lt;h1 id=&quot;vue&quot;&gt;Vue&lt;/h1&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20211231212701311.png&quot; alt=&quot;image-20211231212701311&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20211231212836568.png&quot; alt=&quot;image-20211231212836568&quot; /&gt;&lt;/p&gt;

&lt;p&gt;App.vue의 순서가 뒤바껴도 MyBtn 안의 순서에 따라 출력된다.(slot 부분)&lt;/p&gt;

&lt;p&gt;조상 components에서 자식 components 넘겨줄때 props 를 이용한다.&lt;/p&gt;

&lt;p&gt;자식 components에서 후손 components 넘겨줄때 props 를 이용한다.&lt;/p&gt;

&lt;p&gt;조상 components에서 후손 components 넘겨줄때 Provide/Inject를 이용한다.&lt;/p&gt;

&lt;p&gt;vue-router next (404 페이지찾을수 없음 관련)&lt;/p&gt;

&lt;dl&gt;
  &lt;dt&gt;컴포지션 API&lt;/dt&gt;
  &lt;dd&gt;
    &lt;p&gt;대형 프로젝트를 진행할 시, 변수와 함수가 서로 다른 공간에 위치하는 것은 하나의 기능을 한번에 보기에 매우 어려워짐.&lt;/p&gt;
  &lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;따라서, setup이라는 함수를 제공하는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;컴포지션API&lt;/code&gt; 함수 내에서도 기능별로 함수와 변수를 모아둘 수 있어 가독성이 좋아지며, 마치 Vanila Javascript를 작성하는 것처럼 Vue를 제작할 수 있게 한다.&lt;/p&gt;

&lt;p&gt;flex-shrink: 1;&lt;/p&gt;

&lt;p&gt;css 적용시 페이지 폭에 막혀 원하는 width가 안나올떄 0으로 바꾸면 설정한대로 나온다.&lt;/p&gt;

&lt;p&gt;Vuex(Store) 개요&lt;/p&gt;

&lt;p&gt;:중앙집중식 상태관리&lt;/p&gt;

&lt;p&gt;데이터 전달에 있어 경로 최적화.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220103214754341.png&quot; alt=&quot;image-20220103214754341&quot; /&gt;&lt;/p&gt;

&lt;p&gt;npm i vuex@next 설치.&lt;/p&gt;

&lt;p&gt;store 폴더 생성 - index.js 파일 생성&lt;/p&gt;

&lt;p&gt;main.js에&lt;/p&gt;

&lt;p&gt;import store from ‘./store/index.js’&lt;/p&gt;

&lt;p&gt;createApp(App).use(store)&lt;/p&gt;

&lt;p&gt;여기서 use 는  vue.js 에서 사용할 수 있게금 플러그인 연결&lt;/p&gt;

&lt;p&gt;mutations =&amp;gt; 여기 에서만 데이터가 변경 가능하며 다른 컴포넌트에서는 변경할 수 없다.&lt;/p&gt;

&lt;p&gt;관리가 복잡해지고 유지보수 어려움 떄문이다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220104143350271.png&quot; alt=&quot;image-20220104143350271&quot; /&gt;&lt;/p&gt;

&lt;p&gt;async await 비동기 관련 공부.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220104144537793.png&quot; alt=&quot;image-20220104144537793&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Object.keys() =&amp;gt; 객체데이터의 속성들만 가지고 새로운 배열을 만들어 준다.&lt;/p&gt;

&lt;p&gt;비동기-콜백과 프로미스 객체의 이해(promise)&lt;/p&gt;

&lt;p&gt;코드가 작성된 순서대로 출력되는 함수 = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;동기 방식&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;순서대로 작성됬지만 순서대로 나오지 않을 때 순서대로 나올 수 있게 설정해주는 것 = &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;비동기 방식&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220104155706319.png&quot; alt=&quot;image-20220104155706319&quot; /&gt;&lt;/p&gt;

&lt;p&gt;=&amp;gt; 콜백지옥&lt;/p&gt;

&lt;p&gt;이를 해결하기위해 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Promise&lt;/code&gt; 를 사용하여 해결 가능.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;function a() {
	//promise : 약속의 객체!
	return new Promise(funtion (resolve) {
	
	})
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220104160857323.png&quot; alt=&quot;image-20220104160857323&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;async function test() {
	await a() 
}
// 비동기 함수 


&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220104161423350.png&quot; alt=&quot;image-20220104161423350&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20220104162549014.png&quot; alt=&quot;image-20220104162549014&quot; /&gt;&lt;/p&gt;

&lt;p&gt;async await 사용이 불가능할 때 then 을 메소드체이닝 방식으로 쭈욱 연결해서 사용이 가능하다.&lt;/p&gt;</content><author><name>Xogus Cho</name><email>xogus998@naver.com</email></author><summary type="html">Vue</summary></entry><entry><title type="html">12월4주차</title><link href="https://taehyunn.github.io//four/" rel="alternate" type="text/html" title="12월4주차" /><published>2021-12-17T00:00:00+00:00</published><updated>2021-12-17T00:00:00+00:00</updated><id>https://taehyunn.github.io//four</id><content type="html" xml:base="https://taehyunn.github.io//four/">&lt;h1 id=&quot;4주차-정리&quot;&gt;4주차 정리&lt;/h1&gt;

&lt;h2 id=&quot;toyproject&quot;&gt;toyproject&lt;/h2&gt;

&lt;blockquote&gt;
  &lt;p&gt;진행중 …&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;강의-정리&quot;&gt;강의 정리&lt;/h2&gt;

&lt;p&gt;TypeScript 이어서 …&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20211222144217604.png&quot; alt=&quot;image-20211222144217604&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;aliasing&quot;&gt;Aliasing&lt;/h3&gt;

&lt;p&gt;ex)&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;let person : [string, number ] = [ 'mark'm 35];

type PersonTuple = [string, number];

let another: PersonTuple = ['Anna', 24];
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;$$ TypeScript 순서&lt;/p&gt;

&lt;p&gt;폴더 생성 - &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm init -y&lt;/code&gt;-&amp;gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i typescript -D&lt;/code&gt;-&amp;gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npx tsc --init&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;ex) tsconfig.json에서&lt;/p&gt;

&lt;p&gt;{&lt;/p&gt;

&lt;p&gt;“compileOnSave” : true,&lt;/p&gt;

&lt;p&gt;“compilerOptions”: {&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;dl&gt;
  &lt;dt&gt;}&lt;/dt&gt;
  &lt;dd&gt;
    &lt;p&gt;프로젝트에서 파일을 save하면 컴파일하겠다.&lt;/p&gt;
  &lt;/dd&gt;
&lt;/dl&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;extends&lt;/code&gt; :&lt;/p&gt;

&lt;p&gt;npm install –save-dev @tsconfig/deno&lt;/p&gt;

&lt;p&gt;-&amp;gt;&lt;/p&gt;

&lt;p&gt;{&lt;/p&gt;

&lt;p&gt;“extends” : “@tsconfig/deno/tsconfig.json”&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;files, include, exclude&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;셋다 설정이 없으면 ,전부다 컴파일&lt;/li&gt;
  &lt;li&gt;files
    &lt;ul&gt;
      &lt;li&gt;상대 혹은 절대 경로의 리스트 배열이다.&lt;/li&gt;
      &lt;li&gt;exclude 보다 쎼다.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;include, exclude&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;glob 패턴 (마치 .gitignore)&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;include&lt;/p&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;p&gt;exclude 보다 약하다.&lt;/p&gt;

        &lt;p&gt;*같은걸 사용하면 .tx/ .tsx/ .d.ts 만 include(allowJS)`&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;outDir&amp;gt;&lt;/code&gt;은 include에 있어도 항상 제외한다.&lt;/p&gt;

&lt;hr /&gt;

&lt;dl&gt;
  &lt;dt&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;compileOptions&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;
    &lt;p&gt;외부라이브러리를 사용하는경우 typeing이 안되어있기떄문에 쓴다??&lt;/p&gt;
  &lt;/dd&gt;
&lt;/dl&gt;

&lt;ul&gt;
  &lt;li&gt;typeRoots&lt;/li&gt;
  &lt;li&gt;types&lt;/li&gt;
&lt;/ul&gt;

&lt;dl&gt;
  &lt;dt&gt;항상 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;strict&lt;/code&gt;를 true 로 설정해서 사용하는게 중요.&lt;/dt&gt;
  &lt;dd&gt;
    &lt;p&gt;type checking 옵션을 킨다.&lt;/p&gt;
  &lt;/dd&gt;
&lt;/dl&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;interface-ex&quot;&gt;interface ex)&lt;/h3&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#interface 사용전 !!#


function hello1(person: {name: string; age:number}):void {

console.log(`안녕하세요!${person.name}입니다.` )

}

const p1:  = {

name:&quot;Mark,

age:39,

}

hello1(p1);
ㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡㅡ
#interface 사용후#
interface Person1 {
name:string;
age:number;
} // 인터페이스부분은 컴파일 시 사라지게된다. -&amp;gt; js에 표시되지않음.

function hello1(person: Person1):void {
console.log(`안녕하세요!${person.name}입니다.` )
}

const p1: Person1  = {
name:&quot;Mark,
age:39,
}
hello1(p1);

age는 있을수도 없을수도 있는 형태라면
`age?` 로 표기한다.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;arrow 함수 내에서는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;this&lt;/code&gt;를 사용할 수 없다!&lt;/p&gt;

&lt;p&gt;implements를 이용해 인터페이스의 내용을 바탕으로  class를  만들어낸다.&lt;/p&gt;

&lt;p&gt;ex) class Person implements IPerson1 {}&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;상속&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;interface IPerson2 {
	name: string;
	age?:number;
}

interface IKorean extends IPerson2 {
	city: string;
}
const k: IKOrean = {
	name: &quot; 나&quot;,
	city: &quot;서울&quot;,
}
//
프로젝트할때 상속관계로 interface를 표현하는 경우가 많고 편하다.

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Function interface&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;interface HelloPerson {
	(name: string, age?: number): void;
}
const helloPerson: HelloPerson = funtion(name:string, age:number){
console.log(`안녕하세요!${name}입니다.`);
};
helloPerson(&quot;Mark&quot;, 39);
//에러발생 age:number 부분
//이유는, 실제 구현체는 항상 있는걸로만 표현되있기 때문에 Error가 발생.
따라서, age,number를 지우고 아래처럼 쓰면 정상작동.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;type-alias-vs-interface&quot;&gt;type alias vs interface&lt;/h3&gt;

&lt;p&gt;//type alias&lt;/p&gt;

&lt;p&gt;type 함수이름 = ( food: string) = &amp;gt; void;&lt;/p&gt;

&lt;p&gt;//interface&lt;/p&gt;

&lt;p&gt;interface IEat {&lt;/p&gt;

&lt;p&gt;​	(food: string): void;&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;//type alias&lt;/p&gt;

&lt;p&gt;type PersonList = string[];&lt;/p&gt;

&lt;p&gt;//interface&lt;/p&gt;

&lt;p&gt;interface IPersonList {&lt;/p&gt;

&lt;p&gt;[index:number] : string; // [0] : 이름;&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;h2 id=&quot;class&quot;&gt;Class&lt;/h2&gt;

&lt;p&gt;클래스의 처음은 대문자로 시작 ex) class Person {}&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20211222205155957.png&quot; alt=&quot;image-20211222205155957&quot; /&gt;&lt;/p&gt;

&lt;p&gt;JS로 컴파일되면 es5의 경우 function으로 변경된다&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;var Person = (function() {
	function Person() {
	
	}
	return Person;
}());
var p1 = new Person();
console.log(p1);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;class =&amp;gt; object&lt;/p&gt;

&lt;p&gt;싱글톤 패턴&lt;/p&gt;

&lt;p&gt;클래스로부터 단하나의 객체만 만들어서 사용.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class ClassName {
private static instance: ClassName | null = null;
public static getInstanc() {
//ClassName 으로부터 만든 object가 있으면 그걸리턴
// 없으면, 만들어서 리턴
	if(ClassName === null) {
		ClassName.instance = new ClassName();
	}
	return ClassName.instance;
}
private constructor () {}
}
const a = ClassName.getInstanc();
const b = ClassName.getInstanc();
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;abstract :&lt;/p&gt;

&lt;p&gt;★abstract는 완벽하지않기떄문에 new로 뭘할수없다 = &amp;gt; 오류뜬다.&lt;/p&gt;

&lt;p&gt;★abstract로 구현한 함수를 꼭 구현해줘야한다.&lt;/p&gt;

&lt;p&gt;상속을 통해 가능.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;//기본형식
abstract class 이름 { 
abstract 함수()
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Geneucsm Any와 다른점.&lt;/p&gt;

&lt;p&gt;Any는 모든걸받아서 모든걸 주는 것. &amp;lt;-&amp;gt;&lt;/p&gt;

&lt;p&gt;제네릭은 각자에 맞게 주어준다.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;제네릭함수명&amp;lt;타입(인수: 타입): 리턴타입{
 	return 인수
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;T 부분 -&amp;gt; &amp;lt;T, U&amp;gt; 등 여러개가 들어갈 수 있다.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;Json&lt;/strong&gt;&lt;/p&gt;

&lt;dl&gt;
  &lt;dt&gt;“Json은 Map구조이다.”&lt;/dt&gt;
  &lt;dd&gt;
    &lt;p&gt;Key와 value가 쌍으로 저장되는데, key값이 중복되면안된다.&lt;/p&gt;
  &lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;(즉, 마지막 값만 저장된다.)&lt;/p&gt;

&lt;h2 id=&quot;scss&quot;&gt;SCSS&lt;/h2&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20211227145735497.png&quot; alt=&quot;image-20211227145735497&quot; /&gt;&lt;/p&gt;

&lt;p&gt;반복문&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;@for $i from 1 through 10 { // for(let i=0; i&amp;lt;10; i += 1)
	.box:nth-child(#{$i}) {
		width: 100px 	
	}
} //아래결과
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20211227150222336.png&quot; alt=&quot;image-20211227150222336&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;SCSS함수&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20211227150958799.png&quot; alt=&quot;image-20211227150958799&quot; /&gt;&lt;/p&gt;

&lt;p&gt;색상 내장 함수&lt;/p&gt;

&lt;p&gt;saturate($color, 40%) // 채도&lt;/p&gt;

&lt;p&gt;lighten // 명도&lt;/p&gt;

&lt;p&gt;darken // 어둡게&lt;/p&gt;

&lt;p&gt;invert // 색상을 반전&lt;/p&gt;

&lt;p&gt;mix // 두개의 색상을 섞음&lt;/p&gt;

&lt;p&gt;rgba($color, .5) // 투명도&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;가져오기&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;main.scss / sub1.scss /sub2.scsss 총 3개의 파일을 만들었을 때&lt;/p&gt;

&lt;p&gt;main.scss 에서 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;@import &quot;./sub1&quot;, &quot;./sub2&quot;&lt;/code&gt;로 하여 각 scss의 설정을 가져올 수 있다.&lt;/p&gt;

&lt;dl&gt;
  &lt;dt&gt;&lt;strong&gt;리팩토링&lt;/strong&gt;&lt;/dt&gt;
  &lt;dd&gt;
    &lt;p&gt;결과의 변경 없이 코드의 구조를 재조정한다.&lt;/p&gt;
  &lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;Css의 파일을 Scss의 형식으로 재구성해보았다.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;반복문@each&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;@each $c in $list {1,2,3}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;:list안의 것들을 c라는곳에 반복해서 하나씩 넣어준다.&lt;/p&gt;

&lt;dl&gt;
  &lt;dt&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;@each $key, $value in $map {1,2,3}&lt;/code&gt;&lt;/dt&gt;
  &lt;dd&gt;
    &lt;p&gt;key와 value 형태로 사용할 수 있다.&lt;/p&gt;
  &lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;부트스트랩 part에서 기본적으로 알고있어야 사용이가능하지만,, 중요한 부분은 아니다.&lt;/p&gt;

&lt;p&gt;https://www.curioustore.com/#!/ 변수명 추천 사이트&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;뷰 - 중국의 디자이너가 만듬&lt;/p&gt;

&lt;p&gt;구글이 만든거 - 앵귤러&lt;/p&gt;

&lt;p&gt;페이스북이 만든 거 - 리액트&lt;/p&gt;

&lt;p&gt;둘다 프레임워크이다&lt;/p&gt;

&lt;p&gt;이후 이들보다 좀더 쉬운 형태의 작업방식을 디자인하여 학습시간을 줄일 수 있는&lt;/p&gt;

&lt;p&gt;vue.js가 등장함&lt;/p&gt;

&lt;p&gt;뷰는 앱작업이 약함 하지만, 플러터가 나왔기때문에 이부분 학습도 굿&lt;/p&gt;

&lt;p&gt;웹컴포넌트 ??(아직은 이르다)&lt;/p&gt;

&lt;p&gt;Chrome - Vue.js devtools를 검색해서 설치&lt;/p&gt;

&lt;p&gt;vscode에서 vetur, vue vscode snipperts 2개를 깐다.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i -g @vue/cli&lt;/code&gt; :  프로젝트를 위한 설정/설치를 쉽게 하기 위해 Vue CLi를 제공.&lt;/p&gt;

&lt;p&gt;-g 옵션은 전역에 설치하라는 옵션&lt;/p&gt;

&lt;p&gt;패키지 매니저인 npm을 통해서는 전역과 지역으로 범위를 구분해서 설치하도록 되어있다.&lt;/p&gt;

&lt;p&gt;설치후 버전을 확인하는 명령 -&amp;gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vue --version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;cd first_vue&lt;/code&gt; -&amp;gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm urn serve&lt;/code&gt; 이동한후에 first_vue 프로젝트를 개발 진행용으로 진행&lt;/p&gt;

&lt;p&gt;npm run build &amp;lt;= dist라는 폴더를 만든다 –&amp;gt; 이걸 Netlify(호스팅 해주는거)에 올리면 배포.&lt;/p&gt;

&lt;h2 id=&quot;bootstrap&quot;&gt;bootstrap&lt;/h2&gt;

&lt;p&gt;bootstrap을 통해 할 수 있는 것들.&lt;/p&gt;

&lt;p&gt;class 이름만으로도 버튼 생성이 가능.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;01.CDN 프로젝트 생성&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;트리 쉐이킹(Tree Shaking)이란 단일 번들을 최적화할 때 사용되는..필요하지 않은 코드를 제거하는 기술.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;bootstrap 설치 및 연결&lt;/p&gt;

&lt;p&gt;bootstrap 사이트 - get started 클릭 - CSS, JS  link 복붙 및 Bundle(묶음이라는 뜻) 및 Separate  에서  script 복붙&lt;/p&gt;

&lt;p&gt;popper.js =&amp;gt; 팝업창을 원하는곳에 간단하게 만들어주는 것.(사이트 있음)&lt;/p&gt;

&lt;p&gt;사이트에서 사이드바-&amp;gt; Components 로 이동 -&amp;gt; Dropdown 클릭 후 코드 복사후 넣기.(실습해보기)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;양식&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Forms &lt;/code&gt;&lt;/p&gt;

&lt;p&gt;(이메일 및 패스워드) 입력 폼들의 소스코드가 있음.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;NPM 프로젝트 생성&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.npm init -y =&amp;gt; packge.json 파일 생성&lt;/p&gt;

&lt;p&gt;2.npm i parcel-bundler -D&lt;/p&gt;

&lt;p&gt;3.scripts 부분 -&amp;gt; “dev”: “ parcel index.html”&lt;/p&gt;

&lt;p&gt;​							“build”: “parcel build index.html” 해주기&lt;/p&gt;

&lt;p&gt;4.bootstrap 사이트로 이동 -&amp;gt; npm install bootstrap@next 설치&lt;/p&gt;

&lt;p&gt;5.main.js 파일 생성 - import bootstrap from ‘bootstrap/dist/js/bootstrap.bundle’&lt;/p&gt;

&lt;p&gt;6.scss 폴더생성 -&amp;gt; main.scss 파일 생성 -&amp;gt; @import “../node_modules/bootstrap/scss/bootstrap.scss” 해주기&lt;/p&gt;

&lt;p&gt;7.scss와 달리 js는 node_modules에 바로 접근이 가능하다. (CDN 방식과 반대)&lt;/p&gt;

&lt;p&gt;장점.&lt;/p&gt;

&lt;p&gt;bootstrap에서 필요한 부분들만 가져와 사용할 수 있으며, 커스터마이징이 가능하다.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;테마 색상 커스터마이징&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;bootstrap 사이트 사이드바에 Customize 로 이동하여 참고.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;성능 최적화(트리 쉐이킹&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Optimize&lt;/p&gt;

&lt;p&gt;가져오고 싶은 것들만 가져오기&lt;/p&gt;

&lt;h2 id=&quot;bundler&quot;&gt;Bundler&lt;/h2&gt;

&lt;p&gt;scss , react 등 을 Bundler 를 통해 변환을 해주는 것.&lt;/p&gt;

&lt;p&gt;html,css,javascript 로만 코딩을 하기에는 비효율적인 면들이 존재한다.&lt;/p&gt;

&lt;p&gt;따라서, 다양한 기능을 가진 패키지들을 통해서 개발을 진행하고 번들러를 통해 변환을 진행한다.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;parcel-Bundler&lt;/code&gt; : 중/소형 프로젝트에 적합.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Webpack&lt;/code&gt;: 중/대형 프로젝트에 적합.&lt;/p&gt;

&lt;h4 id=&quot;정적파일연결&quot;&gt;정적파일연결&lt;/h4&gt;

&lt;p&gt;Online ICO converter 사이트를 통해 파비콘 파일생성 가능.&lt;/p&gt;

&lt;p&gt;parcel plugin static files copy 사이트를 통해 자동으로 번들러를 통해 dist로 붙여넣기 해주는 옵션을 설정한다&lt;/p&gt;

&lt;p&gt;-&amp;gt; npm i parcel plugin static files copy 터미널 실행&lt;/p&gt;

&lt;p&gt;package.json 에 “staticFiles” : {“staticPath”: “static”} 해준다.&lt;/p&gt;

&lt;p&gt;static 폴더 만들고 favicon.ico 파일을 넣어준다&lt;/p&gt;

&lt;h4 id=&quot;autoperfixer&quot;&gt;autoperfixer&lt;/h4&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;npm i -D postcss autoprefixer 설치&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Vender 사의 접두사를 자동으로 붙여주는 것&lt;/p&gt;

&lt;p&gt;이 후,&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&quot;browserslist&quot; : [
&quot;&amp;gt;1%&quot;//전세계의 점유율이 1%인 브라우저 뜻
&quot;last 2 versions&quot;//해당하는 브라우저의 마지막  2개의 버전은 지원.
]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.postcssrc.js&lt;/code&gt; 파일 생성해준다. 이름을 똑같이 만들어야 parcel-bundler 가 인식을 한다.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;웹에서 작용하는 js 는 import,export&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;const autoprefixer = require('autoprefixer')
== import autoprefixer frome 'autoprefixer' 와 같다.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Node.js에서 작동하는 require(),module.exports&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;module.exports = {
	plugins: [
	autoprefixer
	]
}
==
export {
	plugins: [
	autoprefixer
	]
} 와 같다.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;autoprefixer 와 postcss 간의 충돌 오류가 자주 발생할 수있다.&lt;/p&gt;

&lt;p&gt;따라서 , autoprefixer 를 다운그레이드 해주면된다.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i -D autoprefixer@버전숫자&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;★★ 쓰는 이유 :  구버전의 브라우저에서 적용이 가능하게끔 하기 위함이다.&lt;/p&gt;

&lt;h1 id=&quot;vue&quot;&gt;Vue&lt;/h1&gt;

&lt;p&gt;React 배우기에 앞서 입문으로 배우기 좋다.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;01. 개요&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Vue.js 3버전을 학습할 예정이다.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
  &lt;li&gt;Vue.js 홈페이지로 이동한다.&lt;/li&gt;
  &lt;li&gt;왼쪽 상단에 필수요소 부분 설치방법으로 이동한다.&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
  &lt;p&gt;CDN 방식 &amp;lt;–&amp;gt; npm 방식 이 존재한다.&lt;/p&gt;

  &lt;p&gt;npm 은 Vue를 사용하여 대규모 애플리케이션을 구축할 떄 용이하다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;//기본 사용 구조 예시

&amp;lt;div id=&quot;app&quot;&amp;gt;
	&amp;lt;h1&amp;gt;&amp;lt;/h1&amp;gt;
&amp;lt;/div&amp;gt;

Vue.createApp({
	date() {
	return {
	message: 'Hello Vue!'
	}
	}
}).mount('#app') //mount를 통해 접근한다.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;02. CLI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm install -g @vue/cli&lt;/code&gt; 를 터미널에서 진행.&lt;/p&gt;

&lt;p&gt;Google검색 -&amp;gt; Vue CLi 페이지로 이동 후 get started 클릭 -&amp;gt; Creating a Project 로 이동.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;vue create hello-world&lt;/code&gt; 명령어 -&amp;gt; hello-world 프로젝트를 생성할 수 있다.&lt;/p&gt;

&lt;p&gt;특정한 규칙에 맞게 동작되는지 확인하기 위해 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lint&lt;/code&gt; 명령어를 통해 서버를 실행가능.&lt;/p&gt;

&lt;p&gt;Vue&lt;/p&gt;

&lt;p&gt;장점 : 구성옵션들을 최대한 신경안쓰고 문법에 집중해서 작성가능 (입문자)&lt;/p&gt;

&lt;p&gt;단점 : 나만의 프로젝트를 세부적으로 관리하면서 하는 중급자 이상한테는 아쉬울 수 있다.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;03.Webpack Template&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npx degit 저장소이름 새로운이름의폴더&lt;/code&gt;   로 복제됨&lt;/p&gt;

&lt;p&gt;git clone과 다른 점 =&amp;gt; 기본적인 버전 내역이 삭제된 상태로 복제된다.&lt;/p&gt;

&lt;p&gt;웹팩을 기반으로하는 뷰 프로젝트 생성하는 것이다.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i veu@next&lt;/code&gt;로 신버전 설치.&lt;/p&gt;

&lt;p&gt;.vue라는 확장자라는 파일을 관리하기 위해서는&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i -D vue-loader@next vue-style-loader @vue/compiler-sfc&lt;/code&gt;를 설치한다.&lt;/p&gt;

&lt;p&gt;=&amp;gt; vue 파일을 변환해서 브라우저에서 동작하도록 보여준다.&lt;/p&gt;

&lt;p&gt;weebpack.config.js 에서 js불러오는 부분 수적하기 (entry)&lt;/p&gt;

&lt;p&gt;rules에 설정해주기.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;rulex: [
	test: /\.vue$/,
	use:'vue-loader'
]
그 아래 use 부분에
'vue-style-loader' 추가해주기. //뷰 파일 내부에 스타일 태그를 해석해서 동작하게 해주는 것.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;맨 위에&lt;/p&gt;

&lt;p&gt;const {VueLoaderPlugin} = require(‘vue-loader’) 해주고&lt;/p&gt;

&lt;p&gt;plugins 부분으로 아래로 이동해서 안쪽에 new VueLoaderPlugin() 생성자 함수 설정해주기&lt;/p&gt;

&lt;p&gt;기존 js 폴더는 삭제하고 src 폴더를 만든후 App.vue 파일 및 main.js 파일을 만든다.&lt;/p&gt;

&lt;p&gt;App.vue 파일 내용은 아래와 같이 작성한다.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-&amp;gt;&quot;&gt;&amp;lt;template&amp;gt;
	&amp;lt;h1&amp;gt;&amp;lt;/h1&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script&amp;gt;
export default {
	date() {
		return {
			message: 'Hello World!'
		}
	}
}
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;main.js 파일 내용은 아래와 같이 그 후 작성해준다&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;CDN
import Vue from 'vue'
import App from './App.vue'

Vue.createApp(App).mount('#app')

CLi 
객체 구조 분해를 통해 가져올 수 있다.
import {createApp} from 'vue'
import App from './App.vue'

Vue.createApp(App).mount('#app')

이 후 npm run dev 를 해주면 열린다.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;index.html 파일 내용은 아래와 같이 작성해준다.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;바디 태그 안에
&amp;lt;div id = &quot;app&quot;&amp;gt;&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;확장자 관련 부분&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;확장자 (.js , .vue) 를 안해줄 시 어떤 파일인지 몰라 오류가 발생한다. (확장자 표기)&lt;/p&gt;

&lt;p&gt;따라서,&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20211229142515722.png&quot; alt=&quot;image-20211229142515722&quot; /&gt;&lt;/p&gt;

&lt;p&gt;이와 같이 설정 해준다면 확장자 명을 붙이지 않아도 오류가 발생하지 않는다.&lt;/p&gt;

&lt;p&gt;파일을 가져올 때 확장자 명을 붙이지 않아도 됨.&lt;/p&gt;

&lt;p&gt;App.vue 파일에 연결할 새로운 Vue 파일들을 설정한다.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;새로운 폴더 생성 (이름은 components)&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;HelloWorld.vue 파일 생성해준다.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;static 안에 images 폴더를 src 안으로 넣어준다.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;images 폴더 명을 assets로 변경해준다.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;template&amp;gt;
	&amp;lt;img src=&quot;~assets/이미지파일명&quot;&amp;gt;
&amp;lt;/template&amp;gt;	
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;이 경로를 통해서 이미지를 가져와서 vue파일에서 분석해서 화면에 보여주도록 해줘야 한다&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;npm i -D file-loader 를 터미널을 통해 설치해준다.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;웹팩 컨피그 파일로 이동한다.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;.js 찾아서 기본적인 규칙을 적용하는 부분 밑에다&lt;/p&gt;

    &lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;{
	test:/\.(png|jpg|jpe?g|gif|webp)$/  // ?는  e가 포함된 것 포함되지 않은 것 모두 적용하는 뜻
	use:'file-loader'
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-17-four/image-20211229142515722-16407559118911.png&quot; alt=&quot;image-20211229142515722&quot; /&gt;&lt;/p&gt;

&lt;p&gt;extensions 부분 아래에&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;alias 경로 별칭을 설정해준다.
	alias: {
		'~':'path.resolve(__dirname, 'src')',	
		'assets':'path.resolve(__driname, 'src/assets')'
	} // __dirname 은 현재 웹팩컨피그 파일이있는 그경로를 의미.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;04.ESLint 구성&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;터미널에서 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i -D eslint eslint-plugin-vue babel-eslint&lt;/code&gt; 3가지 패키지 설치해 준다.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.eslintrc.js&lt;/code&gt; 파일 생성해준다.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;module.exports = {
	env: {
		browser: true,
		node: true
	}, // node와 browser 환경에서 코드 검사를 하는 부분
	extends: [
	//vue
	//'plugin:vue/vue3-essential'	//레벨1
	'plugin:vue/vue3-strogly-recommended'// 코드 규칙 권장사항 레벨2 레벨2를 적용한다
	
	//js
	'eslint:recommended' //eslint에서 권장하는 규칙을 통해 검사한다.
	
	],//코드 검사를 할 규칙들 정의
	parserOptions: {
		parser: 'bable-eslint' //babel은 ES6이상의 문법을 구버전의 브라우저에서 동작할 수 있게 변환시켜줌.
	}, // 코드를 분석할 수 있는 분석기를 설정해준다.
	rules: {
	//코드레벨2를 적용시 작성하지 않아도 된다. 다만, 사용자의 입맞에 맞게 변경하려면 작성해주면 된다.
	}
}
//하나의 객체 리터럴 반환
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;eslint-plugins-vue 사이트(eslint.vuejs.org) 에서 규칙을 입맞에 맞게 참고하여 설정할 수 있다.&lt;/p&gt;

&lt;p&gt;eslint 관련 완성된 템플릿 =&amp;gt; `https://github.com/ParkYoungWoong/vue3-webpack-template 에서 확인 가능&lt;/p&gt;

&lt;p&gt;데이터를 갱신하면 화면도 바뀐다. = &amp;gt; 반응성(Reactivity)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;조건문과 반복문&lt;/strong&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;div v-if=&quot;count&amp;gt;4&quot;&amp;gt;&amp;lt;/div&amp;gt; 
v-if, v-for 같은 조건/반복문을 설정할 수 있다. 디렉티브(Directive)라고 부른다.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;style 부분에 scoped 선언 시 다른 컴포넌트에 영향을 주지 않는다.&lt;/p&gt;

&lt;p&gt;created() {} : components 가 실행된 후 실행되는 함수&lt;/p&gt;

&lt;p&gt;mounted() {}: Dom과 연결된 후 실행되는 함수&lt;/p&gt;

&lt;p&gt;라이프사이클 중 위 2개가 가장 많이 쓰인다.&lt;/p&gt;

&lt;h4 id=&quot;템플릿-문법&quot;&gt;템플릿 문법&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;../images/image-20211229190759703.png&quot; alt=&quot;image-20211229190759703&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;watch&lt;/code&gt; 옵션 은 감시하는 기능&lt;/p&gt;

&lt;p&gt;console.log 를 통해 콘솔에서 확인가능.&lt;/p&gt;

&lt;p&gt;event.stopPropagation()&lt;/p&gt;

&lt;p&gt;=&amp;gt; 부모 div안에 자식 div가 있고 클릭 이벤트 시 자식을 클릭했을때 부모의 것도 출력이 된다. 이를 방지하기위해 설정해준다.&lt;/p&gt;

&lt;p&gt;(버블링 방지)&lt;/p&gt;

&lt;p&gt;=== @click.stop=”“으로 설정 .&lt;/p&gt;

&lt;p&gt;이벤트 캡쳐링&lt;/p&gt;

&lt;p&gt;:나오는 순서를 반대로 바꿔주는 것이다 ===@click.capture=”“으로 설정 @click.capture.stop 도 가능.&lt;/p&gt;

&lt;p&gt;@click.self=” “ 는 해당영역을 정확히 입력했을 떄만 동작하도록 만들어주는 것.&lt;/p&gt;

&lt;p&gt;@wheel 은 휠을 위아래 움직일때마다 출력.&lt;/p&gt;

&lt;p&gt;@wheel.passive 는  버벅임을 없애기 위해 스크롤의 움직임 따로, 로직 따로 독립적으로 돌아가게 해준다.&lt;/p&gt;

&lt;p&gt;키 수식어&lt;/p&gt;

&lt;p&gt;@keydown : 키보드 입력마다 콘솔에 출력된다.&lt;/p&gt;

&lt;p&gt;v-model.trim = “ “ 앞뒤의 공백문자열 없이 출력가능&lt;/p&gt;

&lt;p&gt;v-model은 양방향바인딩.&lt;/p&gt;

&lt;p&gt;Vue 설치시&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;{
	test:/\.vue$/,
	use: 'vue-loader'
}
{
	test:/\.s?css$/,
	use: [
		'vue-style-loader'
	]
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;vue-style-loader : App.vue 와 같이 .vue로 끝나는 확장자 파일들에 내부에서 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;style&amp;gt;&lt;/code&gt;이라는 태그로 css 내용을 작성이 가능하다.&lt;/p&gt;

&lt;p&gt;npm i -g @vue/cli&lt;/p&gt;

&lt;p&gt;vue create 프로젝트 명&lt;/p&gt;

&lt;p&gt;npm i vue@next : 최신버전 Vue 설치&lt;/p&gt;

&lt;p&gt;npm i -D vue-loader@next (최신버전설치) vue-sttle-loader @vue/compiler-sfc(뷰파일을  변환해서 브라우저에서 동작할 수 있는 형태로 바꿔준다)&lt;/p&gt;

&lt;p&gt;3개의 패키지 설치.&lt;/p&gt;</content><author><name>Xogus Cho</name><email>xogus998@naver.com</email></author><summary type="html">4주차 정리</summary></entry><entry><title type="html">12월3주차</title><link href="https://taehyunn.github.io//three-js/" rel="alternate" type="text/html" title="12월3주차" /><published>2021-12-13T00:00:00+00:00</published><updated>2021-12-13T00:00:00+00:00</updated><id>https://taehyunn.github.io//three-js</id><content type="html" xml:base="https://taehyunn.github.io//three-js/">&lt;h2 id=&quot;홈페이지-만들기&quot;&gt;홈페이지 만들기&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;header&amp;gt;&lt;/code&gt;는 주로 제목,네비게이션을 포함하고 로고,목차,검색폼을 그룹핑 할 수 있음.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;nav&amp;gt;&lt;/code&gt; 는 주요 네비게이션을 그룹핑한다.  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;header&amp;gt;&lt;/code&gt; 아래 소제목&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;article&amp;gt;&lt;/code&gt; 는 본문내용 작성&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;section&amp;gt;&lt;/code&gt; 는 영역 내 분리&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;aside&amp;gt;&lt;/code&gt;는 분리된 영역&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;lt;main&amp;gt;&lt;/code&gt;는 article 까지 포함하여 작성해서 가지고있다.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;css-복습&quot;&gt;CSS 복습&lt;/h3&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;font-style&lt;/th&gt;
      &lt;th style=&quot;text-align: center&quot;&gt;글자 기울기&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;font-weigh&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;글자 두께&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;font-size&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;글자 크기&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;line-height&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;줄 높이&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;font-family&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;폰트(서체)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;text-align&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;정렬&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;margin&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;각 list 요소들 상하좌우에 크기 적용(시계방향 순)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;margin-bottom&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;요소의 아래에만 크기 적용(시계방향 순)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;padding&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;요소의 내부 여백 지정(시계방향)&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;border-radius&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;모서리 둥글게&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;overflow&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;요소의 크기 이상으로 내용이 넘쳤을 때, 보여짐을 제어&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;display&lt;/code&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;block,inline,inline-block&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;text-align&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;문자 정렬 방식&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;line-height&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;한줄의 높이를 설정&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;text-indent&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;양수,음수 가능 글자를 밀어쓰는게 가능&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;background-attachment&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;scroll:이미지가 요소를 따라 같이 스크롤&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;fixed:이미지가 뷰포트에 고정. 스크롤 x&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;dispayl:flex;&lt;/code&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;수평 정렬&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;flex items&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;자동으로 아이템이 된다.&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;flex-wrap&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;flex items 묶음(줄 바꿈) 여부&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;justify-content&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;주 축의 정렬 방법&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;align-content&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;교차 축의 여러 줄 정렬 방법&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;align-items&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;교차 축의 한 줄 정렬 방법&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt; &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt; &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt; &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt; &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt; &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt; &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt; &lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt; &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;display : inline-flex &lt;/code&gt; :  인라인 요소의 크기만큼 할당되면서 flex가 적용된다.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;flex-direction&lt;/code&gt;: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;row&lt;/code&gt;와&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;row-reverse&lt;/code&gt;가 있다 왼쪽부터정렬 / 오른쪽부터 정렬.&lt;/p&gt;

&lt;p&gt;(주축을 설정할때 사용한다.)&lt;/p&gt;

&lt;p&gt;세로일 때는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;column&lt;/code&gt;으로 설정한다.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;오픈 그래프&lt;/code&gt;: 웹페이지가 소셜미디어(페이스북 등)로 공유될  때 우선적으로 활용되는 정보를 지정하는것.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211206142536966.png&quot; alt=&quot;image-20211206142536966&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/og&quot; alt=&quot;image-20211206142649119&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;description&lt;/code&gt; 은 간단히 작성한다. 길게 작성할경우 카카오톡에서 악성스크립트로 인식할 수 있음.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;SEO&lt;/code&gt;: 검색 엔진 최적화, Search Engine Optimization)&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;구글이나 네이버 등에 자신의 Web site/Page를 노출할 수 있도록 정보를 최적화 하는 작업을 말한다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;※ 필자는 이 부분에 대해 굉장히 어려움을 겪었고 찾던 부분이였습니다….. ※&lt;/p&gt;

&lt;p&gt;※ 모든 Icons , 이미지 등을 매번 디자이너에게 요청하는 것도 쉬운일은 아니다..&lt;/p&gt;

&lt;p&gt;※ 따라서, 이런 부분들을 찾아서 적용할 수 있는 부분들을 찾아서 사용하는 것이 좋다.&lt;/p&gt;

&lt;p&gt;심지어, 해당 팀에 디자이너가 없을 수 있기 때문에 중요하게 짚고 넘어 가는 것이 좋습니다.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fonts.google.com&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;=&amp;gt;폰트 설정 적용&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;google material icons&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;=&amp;gt; 아이콘 설정 적용&lt;/p&gt;

&lt;h4 id=&quot;서브메뉴-만들기&quot;&gt;서브메뉴 만들기&lt;/h4&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;a 태그&lt;/code&gt; 사용 시 하이퍼링크 속성은 살려두되 기능은 작동하지않게끔하려면&lt;/p&gt;

&lt;p&gt;javascript:void(0) 을 삽입해주면 기능작성이 준비되있지않아도 살려둘 수 있다.&lt;/p&gt;

&lt;h3 id=&quot;드롭다운-메뉴-만들기&quot;&gt;드롭다운 메뉴 만들기&lt;/h3&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  margin: auto;
  부모에게 relative 를 주고 
  위치 상 부모 기준으로 가운데 위치한다.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;position&lt;/code&gt; 사용시 자동으로 inline 에서 block 으로 바뀐다.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;BEM&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;HTML 클래스 속성의 작명법&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;요소__일부분 표시&lt;/p&gt;

&lt;p&gt;요소–상태&lt;/p&gt;

&lt;h3 id=&quot;전역-배지gsap&quot;&gt;전역 배지(GSAP)&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;p&gt;Javescript 부분 참고(코드)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;이미지에 글씨가 포함되 있으면 대체텍스트 alt에 명시해주는게 좋다&lt;/p&gt;

&lt;h3 id=&quot;position&quot;&gt;position&lt;/h3&gt;

&lt;p&gt;굉장히 중요한 부분.&lt;/p&gt;

&lt;p&gt;float, flex =&amp;gt; flex를 요즘 더 많이 쓰는 추세.&lt;/p&gt;

&lt;p&gt;after 이용하여 clear:both 하여 float 취소시켜주면서 사용하는 방법 숙지.&lt;/p&gt;

&lt;p&gt;swiperjs 구글에 검색.&lt;/p&gt;

&lt;p&gt;swiperjs 와 관련하여 현재 opacity 부분 promotion 부분에 적용이 안된다.&lt;/p&gt;

&lt;p&gt;swiper-slide-active에&lt;/p&gt;

&lt;h2 id=&quot;padding-top&quot;&gt;padding-top&lt;/h2&gt;

&lt;p&gt;padding-top &amp;lt;– 부모요소의 width 길이를 기준으로 %하여 세로 가 계산된다 항상.&lt;/p&gt;

&lt;p&gt;중요한 부분!!!!&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;youtube iframe api&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;:사이트에서 유튜브 영상 삽입하여 보여줄 수 있는 방법.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;랜덤한 숫자를 생성하는 함수&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;// 범위 랜덤 함수 ( 소수점 2자리 까지)&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;function random(min , max){
// `.toFixed()`를 통해 반환된 문자 데이터를,
// `parseFloat()`을 통해 소수점을 가지는 숫자 데이터로 변환
  return parseFloat((Math.random() * (max - min) + min).toFixed(2))
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;※모든 내용은 프로젝트 코드를 참조하시오.&lt;/p&gt;

&lt;h2 id=&quot;논외&quot;&gt;논외&lt;/h2&gt;

&lt;p&gt;Figma 툴 사용을 높이자.&lt;/p&gt;

&lt;h2 id=&quot;markdown&quot;&gt;Markdown&lt;/h2&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;README.md&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;새폴더 만들기 -&amp;gt; vscode에서 폴더 선택해서 열기 -&amp;gt; 파일생성하기(README.md)&lt;/p&gt;

&lt;h2 id=&quot;nodejs&quot;&gt;Node.js&lt;/h2&gt;

&lt;h5 id=&quot;개요-및-설치&quot;&gt;개요 및 설치&lt;/h5&gt;

&lt;p&gt;Chrome V8 JavaScript 엔진으로 빌드된 javaScript 런타임&lt;/p&gt;

&lt;p&gt;:프로그래밍 언어가 동작하는 환경 (런타임)&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;nodejs.org 검색을 통해 이동.&lt;/li&gt;
  &lt;li&gt;LTS(장기적으로 안정되고 신뢰도가 높은 버전 제품화 과정에 용이)를 다운받는다.&lt;/li&gt;
&lt;/ul&gt;

&lt;h5 id=&quot;nvm-사용법&quot;&gt;NVM 사용법&lt;/h5&gt;

&lt;hr /&gt;

&lt;p&gt;nvm ls&lt;/p&gt;

&lt;p&gt;nvm install 버전 입력&lt;/p&gt;

&lt;p&gt;nvm use 버전입력&lt;/p&gt;

&lt;p&gt;node –version 확인&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvm 변경할때는&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;nvm use  버전입력&lt;/p&gt;

&lt;p&gt;nvm 지우기 : nvm uninstall 버전입력&lt;/p&gt;

&lt;hr /&gt;

&lt;h4 id=&quot;nvm-개요-1&quot;&gt;NVM 개요 (1)&lt;/h4&gt;

&lt;dl&gt;
  &lt;dt&gt;npm(node package manager)&lt;/dt&gt;
  &lt;dd&gt;
    &lt;p&gt;전 세계의 개발자들이 만든 다양한 기능들을 관리.&lt;/p&gt;
  &lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;&lt;strong&gt;npm install XXX 를 통해 우리가 설치해서 사용할 수 있다.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;npm init -y&lt;/p&gt;

&lt;p&gt;package.json 파일이 생성됨 ( 패키지 관리하기 위해)&lt;/p&gt;

&lt;p&gt;npm install parcel-bundelr -D : parcel-bundler 를 설치한다&lt;/p&gt;

&lt;p&gt;npm install lodash&lt;/p&gt;

&lt;p&gt;한번 설치한 패키지는 package.json에 남게되고 다시 설치를 진행할 경우)npm install) 설치된다.&lt;/p&gt;

&lt;p&gt;package-lock.json 이라는게 생긴다. =&amp;gt; 자동으로 관리되는 파일.&lt;/p&gt;

&lt;p&gt;package.json =&amp;gt; 직접적으로 관리하는 파일.&lt;/p&gt;

&lt;p&gt;위 두개는 절대 지워지면 안된다.&lt;/p&gt;

&lt;p&gt;-D 를 붙이는경우 실제 웹사이트에서 사용되지 않는 개발에 사용할떄만(개발용) 의존하는 용도&lt;/p&gt;

&lt;p&gt;일반 의존성 설치는 붙이지않는다.&lt;/p&gt;

&lt;p&gt;package.json =&amp;gt; scripts 부분에 “dev”:”parcel index.html”을 해준다.&lt;/p&gt;

&lt;p&gt;html 실행 시 서버를 실행하는 부분!!!!!!&lt;/p&gt;

&lt;p&gt;“build”: “parcel build index.html” +&amp;gt;결과를 보이겠다!!!&lt;/p&gt;

&lt;p&gt;parcel-bundler를 설치했기 때문에 위 구문을 적용하면 우리 프로젝트 내에서만 구동되는 서버를 실행시켜준다.&lt;/p&gt;

&lt;p&gt;로컬에서 개발서버를 열겠다!! 라는 의미.&lt;/p&gt;

&lt;p&gt;그다음 =&amp;gt; npm run dev 를 하면&lt;/p&gt;

&lt;p&gt;홈페이지 주소가 나오고 우리가 작성한 main.js 부분이 출력된다 (console)&lt;/p&gt;

&lt;p&gt;ctrl + c : 서버 종료&lt;/p&gt;

&lt;p&gt;.gitignore 파일을 만든다 (  git에서 무시할 파일설정)&lt;/p&gt;

&lt;p&gt;.cache/ dist/ node_modules/ 등&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;위의 과정들을 하는 이유&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;실제 개발에서는 open with liveserver 를 하지 않고&lt;/p&gt;

&lt;p&gt;로컬 서버를 열어서 개발을 하기 때문이다.&lt;/p&gt;

&lt;p&gt;숙지할것.&lt;/p&gt;

&lt;h2 id=&quot;ecma-스크립트&quot;&gt;ECMA 스크립트&lt;/h2&gt;

&lt;p&gt;ES라고도 부른다.&lt;/p&gt;

&lt;p&gt;(EX6 ES2015 등)&lt;/p&gt;

&lt;h3 id=&quot;정을수-강사님-수업-javascript&quot;&gt;정을수 강사님 수업 (JavaScript)&lt;/h3&gt;

&lt;p&gt;https://pythontutor.com/&lt;/p&gt;

&lt;p&gt;찾아보기&lt;/p&gt;

&lt;p&gt;js 는 모든 코드를 객체화해서 관리한다 !! 의 느낌.&lt;/p&gt;

&lt;p&gt;프론트엔드 개발 기술면접 질문&lt;/p&gt;

&lt;p&gt;블랙스코프 const let 등&lt;/p&gt;

&lt;p&gt;호이스팅 . http  런타임 객체지향 프로토타입 등&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;js,css,html 에 대해 상세히 공부를 하자 이론에 대해서…&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;블랙스코프 안에있는 함수는 왜 호이스팅이 안되는지!!? =&amp;gt; 조사할것&lt;/p&gt;

&lt;p&gt;브라우저 렌더링 , http , 자바스크립트 동작원리 랑 핵심개념&lt;/p&gt;

&lt;p&gt;-&amp;gt; 콜 스택, 이벤트 루프 , 스코프 , 실행 컨텍스트 , 프로토타입&lt;/p&gt;

&lt;p&gt;협업(팀프로젝트)과 관련하여
 - 협업 과정에서 타협이 필요한 상황이 있었는지,&lt;/p&gt;

&lt;p&gt;- 프로젝트 진행 시, 개발부터 배포까지의 프로세스 설명
 - 다른 직군(기획, 설계, 백엔드 개발자 등)과의 커뮤니케이션 경험&lt;/p&gt;

&lt;p&gt;적성 및 인성 관련하여
 - 왜 프론트엔드 개발자 하고싶냐
 - 성취감을 느꼈던 경험
 - 입사 후 자기개발에 대한 포부 (앞으로의 커리어 관리)
 - 평소 어떻게 공부했느냐
 - 요즘 흥미가 있는 기술, framework
 - 회사에 기여할 수 있다고 자부할 수 있다고 느끼는 자신만의 특별한 무기
 - 클린코드에 대한 자신의 생각
 - 읽었던 개발 관련 서적 관련
 - 회사에서 강제로 업무를 변경(프론트엔드 -&amp;gt; 기획자)을 요청 할 경우 어떻게 할 것인가&lt;/p&gt;

&lt;p&gt;리액트 공부할것. 중심으로!&lt;/p&gt;

&lt;p&gt;코딩테스트와 실제 적용된 기술  스택을 많이 본다.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;typeof : 데이터의 타입을 알아내서 출력한다.&lt;/p&gt;

&lt;p&gt;import 파일명 from ‘./파일앞의이름만’ -&amp;gt; Js에 해당&lt;/p&gt;

&lt;p&gt;js끼리 연결할 수 있다. &amp;lt;==핵심&lt;/p&gt;

&lt;h3 id=&quot;비교-연산자&quot;&gt;비교 연산자&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;===&lt;/code&gt;  : ex) console.log(a===b)&lt;/p&gt;

&lt;p&gt;서로 다르면 false 같으면 true&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211209201423993.png&quot; alt=&quot;image-20211209201423993&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;!==&lt;/code&gt;: ex) console.log(a!==b)&lt;/p&gt;

&lt;p&gt;서로 다르면 true 같으면 false&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;&amp;amp;&amp;amp;&lt;/code&gt; : 둘다 true면 true 하나라도 다르면 fasle&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;||&lt;/code&gt; : 하나라도 true 면 true&lt;/p&gt;

&lt;p&gt;###&lt;/p&gt;

&lt;h2 id=&quot;js의-기본&quot;&gt;JS의 기본&lt;/h2&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;데이터 타입&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;산술 연산자&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;변수 var, let , const의 유효 범위&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;
        &lt;p&gt;var 같은 경우 함수 내부이외로 let, const 와 다르게 쓰일 수 있고 메모리를 잡아먹을 수 있기&lt;/p&gt;

        &lt;p&gt;에 되도록이면 let, const 를 사용하는 것이 좋다.&lt;/p&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h4 id=&quot;함수&quot;&gt;함수&lt;/h4&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;function sum(x,y) { -&amp;gt; sum(x,y): 매개변수
console.log(x+y)
}
sum (1, 3) // 4 -&amp;gt; 인수
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h4 id=&quot;즉시실행함수&quot;&gt;즉시실행함수&lt;/h4&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;const a= 7;

(function() {
 console.log(&quot;a * 2&quot;)
}());
//
function double() {
 console.log(&quot;a * 2&quot;)
}
double(); // 두개가 같은 내용.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;-&amp;gt; 함수를 생성하자마자 바로 실행이 가능하다.&lt;/p&gt;

&lt;h3 id=&quot;호이스팅-&quot;&gt;호이스팅 ★★★&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;함수 선언부가 유효범위 최상단으로 끌어올려지는 현상&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211210194150225.png&quot; alt=&quot;image-20211210194150225&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Javascript 는 위에서부터 아래로 순서대로 실행이 되기 때문에 위 코드는 오류가 난다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211210194230992.png&quot; alt=&quot;image-20211210194230992&quot; /&gt;&lt;/p&gt;

&lt;p&gt;이 코드는 실행이 가능하게 되어진다. 함수 선언부가 아래에 선언되어 있지만&lt;/p&gt;

&lt;p&gt;실제로 브라우저가 동작할때 자바스크립트 엔진에서는 가장 최상부로 올라가서 만들어지게 되므로 호출이 가능해지게 된다.&lt;/p&gt;

&lt;p&gt;호출하는 부분보다 함수가 아래에 선언되어 져도 실행이 가능한 원리이다.&lt;/p&gt;

&lt;h4 id=&quot;타이머-함수&quot;&gt;타이머 함수&lt;/h4&gt;

&lt;p&gt;1.setTimeout(함수, 시간) : 일정 시간 후 함수 실행&lt;/p&gt;

&lt;p&gt;2.setInterval(함수, 시간) : 시간 간격마다 함수 실행&lt;/p&gt;

&lt;p&gt;3.clearTimeout(); 설정된 Timeout 함수를 종료&lt;/p&gt;

&lt;p&gt;4.clearInterval(): 설정된 Interval 함수를 종료&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;setTimeout(functuin () {}, ㅖ
	console.log('내용')
},3000)  // ms단위(3초) 3초 뒤 실행.


&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;1,3 / 2,4 번 짝궁.&lt;/p&gt;

&lt;h4 id=&quot;콜백&quot;&gt;콜백&lt;/h4&gt;

&lt;p&gt;함수의 인수로 사용되는 함수&lt;/p&gt;

&lt;p&gt;setTimeout(함수, 시간) -&amp;gt; 여기서 인수로 함수가 사용 됐다. 이것을 ‘콜백’이라 한다.&lt;/p&gt;

&lt;p&gt;함수를 호출할때 인수로 사용되는 새로운 함수 =&amp;gt; 콜백 함수&lt;/p&gt;

&lt;h4 id=&quot;생성자-함수&quot;&gt;생성자 함수&lt;/h4&gt;

&lt;p&gt;prototype&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;new 함수명&lt;/code&gt; : 생성자함수&lt;/p&gt;

&lt;p&gt;비교하기위해 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;function 첫글자대문자&lt;/code&gt;를 쓴다.&lt;/p&gt;

&lt;p&gt;ex) function User , new User&lt;/p&gt;

&lt;h4 id=&quot;this&quot;&gt;this&lt;/h4&gt;

&lt;p&gt;일반 함수는 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;호출 위치&lt;/code&gt; 에서,&lt;/p&gt;

&lt;p&gt;화살표(Arrow) 함수는 자신이 선언된 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;함수 범위&lt;/code&gt;에서 정의&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;const timer = {
name: 'heropy!!',
timeout: function () {
	setTimeout(function () {
		console.log(this.name) // undefined 가 일어난다.
	}, 2000)
}
}
timer.timeout()

setTimeout( () =&amp;gt; {} ) 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;undefined 가 일어난다. : 이유는 setTimeout 이라는 내부로직으로 콜백이되서 실행이 되기 때문에&lt;/p&gt;

&lt;p&gt;따라서, function() 부분을 화살표 함수로 바꿔주면 setTimeout을 감싸고있는 timeout 함수가 있기 떄문에 timeout의 function은 timer를 가리키기 때문에 출력이 된다.&lt;/p&gt;

&lt;h2 id=&quot;20211213&quot;&gt;2021/12/13&lt;/h2&gt;

&lt;h3 id=&quot;es6-classes&quot;&gt;ES6 Classes&lt;/h3&gt;

&lt;p&gt;생성자 함수의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;prototype&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;JS는 prototype 기반의 언어.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;class User {
	constructor[: function ](first, last) { // [: function ] 이 부분이 생략됨.
		this.firstName = first
		this.lastName = last
	}
	getFullName() {
	
	} // prototype을 따로 쓰지 않아도 그 형식에 맞는 것을 정의한다.
}
React 에서 가장 많이 쓰는 구조.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213131508373.png&quot; alt=&quot;image-20211213131508373&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Car 클래스는 license 를 추가하여 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;확장&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;super 가 Vehicle을 대체하여 상속받아 사용할 수 있게 한다.&lt;/p&gt;

&lt;p&gt;음… Vehicle에 정의된 것을 다시 작성하지않고 super를 통해 사용할 수 있다.&lt;/p&gt;

&lt;h3 id=&quot;js-데이터&quot;&gt;JS 데이터&lt;/h3&gt;

&lt;h4 id=&quot;문자&quot;&gt;문자&lt;/h4&gt;

&lt;p&gt;String : “” , ‘’, ``&lt;/p&gt;

&lt;p&gt;Number&lt;/p&gt;

&lt;p&gt;Boolean: true, false&lt;/p&gt;

&lt;p&gt;undefined&lt;/p&gt;

&lt;p&gt;null&lt;/p&gt;

&lt;p&gt;Array: []&lt;/p&gt;

&lt;p&gt;Object&lt;/p&gt;

&lt;p&gt;String mdn : 구글 검색 ㄱㄱ&lt;/p&gt;

&lt;p&gt;String : 전역객체 / 문자영의 생성자.&lt;/p&gt;

&lt;p&gt;따옴표를 사용하여 만드는 방식 =&amp;gt; 리터럴 방식이라 한다.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Api 가져오는 방법 공부하기.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Youtube iframe Api 정의하는 부분.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213135336925.png&quot; alt=&quot;image-20211213135336925&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;trim()&lt;/code&gt;  : 웹사이트 제작시 많이 쓰인다.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;로그인 할때 띄어쓰기 하고 입력할경우 인식오류가 날수 있다 따라서. 그럴때 쓰는 trim() 이라는 메소드가이다&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213135537901.png&quot; alt=&quot;image-20211213135537901&quot; /&gt;&lt;/p&gt;

&lt;p&gt;자주 사용할 만한 숫자와 수학  관련 메서드&lt;/p&gt;

&lt;p&gt;Math.abs() : 주어진 숫자의 절대값을 반환. ex) -1 =&amp;gt; 1&lt;/p&gt;

&lt;p&gt;ex ) Math.ceil (3.14) : 올림을 뜻함. 결과 4&lt;/p&gt;

&lt;p&gt;​		Math.floor(3.14): 내림을 뜻함. 결과 3&lt;/p&gt;

&lt;p&gt;​		Math.round(3.5): 반올림을 뜻함. 겨로가 4&lt;/p&gt;

&lt;p&gt;​		Math.random(): 랜덤한 숫자를 표시&lt;/p&gt;

&lt;h3 id=&quot;배열&quot;&gt;배열&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.concat&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;ex ) console.log(배열.concat(배열))  : 배열을 합쳐서 출력한다. 원본의 배열 데이터는 수정되지 않는다.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;forEach&lt;/code&gt; :&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213143312434.png&quot; alt=&quot;image-20211213143312434&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;map&lt;/code&gt; :&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213143916445.png&quot; alt=&quot;image-20211213143916445&quot; /&gt;&lt;/p&gt;

&lt;p&gt;화살표함수 ★&lt;/p&gt;

&lt;p&gt;const a = fruits.map(  (fruit, index) =&amp;gt; ( { id: index , name: fruit} )    )&lt;/p&gt;

&lt;p&gt;형식으로 쓸수있음&lt;/p&gt;

&lt;p&gt;fruit와 index 두개이므로 소괄호 제거 x&lt;/p&gt;

&lt;p&gt;한개일때는 const a = fruits.map( fruit =&amp;gt; { return number &amp;lt; 3} )요런 형식 가능&lt;/p&gt;

&lt;h3 id=&quot;즉시실행함수-iife&quot;&gt;즉시실행함수 IIFE&lt;/h3&gt;

&lt;p&gt;함수를 만들자마자 바로 실행할 수 있게한다.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;(function() {
	console.log(&quot;예제&quot;)
})();
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.filter&lt;/code&gt;  :&lt;/p&gt;

&lt;p&gt;필터링 된 결과만 반환&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;const numbers = [1,2,3,4]

const b = numbers. filter(number =&amp;gt; {
return number &amp;lt; 3
})
console.log(b) // 결과 [1,2]
console.log(numbers) // 결과 [1,2,3,4]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.find() , .findIndex()&lt;/code&gt; :&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213145450295.png&quot; alt=&quot;image-20211213145450295&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213145528959.png&quot; alt=&quot;image-20211213145528959&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.includes()&lt;/code&gt; : 포함이 되어있는지 확인&lt;/p&gt;

&lt;p&gt;포함되있으면 true ,  없으면 false&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213145733742.png&quot; alt=&quot;image-20211213145733742&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.push() .unshift()&lt;/code&gt; :&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213150839075.png&quot; alt=&quot;image-20211213150839075&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.splice()&lt;/code&gt; :&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213151106213.png&quot; alt=&quot;image-20211213151106213&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213151136278.png&quot; alt=&quot;image-20211213151136278&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213151242999.png&quot; alt=&quot;image-20211213151242999&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213151321112.png&quot; alt=&quot;image-20211213151321112&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;object객체&quot;&gt;Object(객체)&lt;/h3&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213151908907.png&quot; alt=&quot;image-20211213151908907&quot; /&gt;&lt;/p&gt;

&lt;blockquote&gt;

  &lt;p&gt;불변성 :&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213152659738.png&quot; alt=&quot;image-20211213152659738&quot; /&gt;&lt;/p&gt;

&lt;p&gt;=&amp;gt; &lt;strong&gt;서로  다른 메모리 주소를 바라보는 것이기 때문에.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Object.keys&lt;/code&gt; :&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213153627051.png&quot; alt=&quot;image-20211213153627051&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;h4 id=&quot;구조-분해-할당&quot;&gt;구조 분해 할당&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213153826672.png&quot; alt=&quot;image-20211213153826672&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Banana 만 출력하고 싶으면 Apple 부분은 비워두고 ‘  ,  ‘ 를 사용한다. 구조 분해 할당은&lt;/p&gt;

&lt;p&gt;순서대로 출력하기 때문이다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213154438741.png&quot; alt=&quot;image-20211213154438741&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;전개연산자&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213154730209.png&quot; alt=&quot;image-20211213154730209&quot; /&gt;&lt;/p&gt;

&lt;p&gt;원래는 아래처럼 사용해야한다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213154804021.png&quot; alt=&quot;image-20211213154804021&quot; /&gt;&lt;/p&gt;

&lt;p&gt;이걸 쉽게 해주는 것이 전개연산자.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213154859552.png&quot; alt=&quot;image-20211213154859552&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Orange 를 받아줄 수 없기 때문에 위 그림과 같이 사용할 수 있다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;{a,  b , c} &amp;lt;– 이부분 객체데이터를 사용할때 중괄호 사용하는데 화살표함수에서 중괄호는 함수의 범위를 나타내는 단순한 블럭으로 사용하는데 객체데이터를 화살표함수 내에서 축약형으로 반환하고 싶다면.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three/image-20211213155403278.png&quot; alt=&quot;image-20211213155403278&quot; /&gt;&lt;/p&gt;

&lt;p&gt;이와 같이 소괄호안에 중괄호를 써줘야한다.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;불변성&quot;&gt;불변성&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;p&gt;한번 메모리에 만들어지면 1이 있다면 새로 1을 만드는것이 아니라&lt;/p&gt;

  &lt;p&gt;기존의 1이 들어있는 메모리 주소를 가르키게 한다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;단, 참조형 데이터 : Object, Array, function 은 불변성이 없다.&lt;/p&gt;

&lt;p&gt;참조형 데이터 =&amp;gt; 내용이 일치해 보이지만 실제로 다른 메모리 주소에 각각 들어있기 때문에&lt;/p&gt;

&lt;p&gt;비교연산자를 사용하여 비교해도 false가 반환된다.&lt;/p&gt;

&lt;p&gt;이를 해결하기위해  얕은 복사와 깊은 복사를 사용.&lt;/p&gt;

&lt;h4 id=&quot;얕은-복사-깊은-복사&quot;&gt;얕은 복사 깊은 복사&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three-js/image-20211213163023721.png&quot; alt=&quot;image-20211213163023721&quot; /&gt;&lt;/p&gt;

&lt;p&gt;이렇게 할 경우 user 의 age를 수정해도 copyUser 부분도 수정된다. 이를 복사를 통해 해결가능.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three-js/image-20211213163133038.png&quot; alt=&quot;image-20211213163133038&quot; /&gt;&lt;/p&gt;

&lt;p&gt;이렇게 해결 가능.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;또한, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;전개 연산자&lt;/code&gt; 로 해결도 가능하다.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three-js/image-20211213163216993.png&quot; alt=&quot;image-20211213163216993&quot; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;strong&gt;깊은 복사&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;깊은 복사는 javescript 로 구현하기 복잡해서.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;lodash 패키지를 설치해서 구현.

npm install lodash ( 터미널에서 실행한다 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;main.js 상단에  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;import _ from 'lodash'&lt;/code&gt; 를 통해 가져온다.&lt;/p&gt;

&lt;p&gt;그 후 user 아래&lt;/p&gt;

&lt;p&gt;const copyuser = _.cloneDeep(user) 를 해준다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three-js/image-20211213163853396.png&quot; alt=&quot;image-20211213163853396&quot; /&gt;&lt;/p&gt;

&lt;p&gt;얕은 복사를 했을때 age는 변했지만 emails에 push를 했지만 copyUser 부분의 emails도 변경된다&lt;/p&gt;

&lt;p&gt;이유는, user는 복사해서 따로 했지만 그 안의 emails 는 복사한게 아니다. 따라서, 깊은복사로 하여 해결해 준다.&lt;/p&gt;

&lt;p&gt;깊은 복사는 겉의 껍데기 뿐만아니라 그 안의 내용까지 복사하는 것.&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;export default 는 딱 한번만 가능하고&lt;/p&gt;

&lt;p&gt;export 이름 같은 경우에는 여러개 작성이 가능하다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three-js/image-20211213171357997.png&quot; alt=&quot;image-20211213171357997&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;lodash&lt;/code&gt; 사용법&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three-js/image-20211213173807420.png&quot; alt=&quot;image-20211213173807420&quot; /&gt;&lt;/p&gt;

&lt;p&gt;lodash를 통해서 다양한 코드를 작성할 수 있다. 매우 편리하게&lt;/p&gt;

&lt;p&gt;uniaBy, unionBy , find, findindex 까지 가장 많이 쓰이기에 관심가지면 좋다.&lt;/p&gt;

&lt;h2 id=&quot;json&quot;&gt;JSON&lt;/h2&gt;

&lt;p&gt;server 와의 통신을 위해 주로 사용.&lt;/p&gt;

&lt;p&gt;.json 파일은 하나의 문자 데이터이다.&lt;/p&gt;

&lt;p&gt;(import myData from ‘./myData.json’)으로 js 상단에 선언하여 가능&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three-js/image-20211214195139598.png&quot; alt=&quot;image-20211214195139598&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three-js/image-20211214195216766.png&quot; alt=&quot;image-20211214195216766&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;storage&quot;&gt;Storage&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;localStorage.setItem('myCat', ' Tom');&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;-&amp;gt; 현재 도메인의 로컬 Storage 객체에 접근한 후, Storage.setitem()을 사용해 항목 하나를 추가&lt;/p&gt;

&lt;p&gt;Json 문자데이터를 자바스크립트 엔진 형식으로 변경해주는 로직에 대해 이해.&lt;/p&gt;

&lt;h3 id=&quot;axios&quot;&gt;axios&lt;/h3&gt;

&lt;p&gt;axios 패키지를 통해 api를 사용할 수 있다.&lt;/p&gt;

&lt;p&gt;-&amp;gt;npm install axios&lt;/p&gt;

&lt;p&gt;-&amp;gt; import axios frome ‘axios’&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;function 함수명() {
axios.get('주소')
.then((response) =&amp;gt; { //get한 것은 받아서 처리하는 것.
	console.log(response)
})
}
함수명()
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;정규표현식&quot;&gt;정규표현식&lt;/h3&gt;

&lt;p&gt;바탕화면 폴더만들기 /&lt;/p&gt;

&lt;p&gt;vscode에서 열기 /&lt;/p&gt;

&lt;p&gt;npm init -y 해서 package.json 파일 생성/&lt;/p&gt;

&lt;p&gt;npm install parcel-bundler -D/&lt;/p&gt;

&lt;p&gt;index.html 파일만들기/&lt;/p&gt;

&lt;p&gt;main.js 파일 만들기/&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;script src = ./main.js&amp;gt; &amp;lt;-- 설정하기
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;개발서버가 열릴 수 있게 설정하기.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;package.json 에서 &quot;scripts&quot;: 부분에
&quot;dev&quot; : &quot;parcel index.html&quot;,
&quot;build&quot; : &quot;parcel build index.html&quot; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;문자열을 검색하고 대체하는 데 사용 가능한 일종의 형식 언어.&lt;/p&gt;

  &lt;p&gt;간단한 문자 검색부터 이메일, 패스워드 검사 등의 복잡한 문자 일치 기능 등을&lt;/p&gt;

  &lt;p&gt;정규식 패턴으로 빠르게 수행할 수 있다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;https://regexr.com  :  정규식 테스트 사이트.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;리터럴 방식
const regexp1 = /^abc/; // abc로 시작하는 것은 찾는다
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;//리터럴 방식&lt;/p&gt;

&lt;p&gt;/표현/옵션&lt;/p&gt;

&lt;p&gt;/[a-z]/gi&lt;/p&gt;

&lt;p&gt;gi : 모든 내용을 찾겠다(g) 와 대소문자 가리지않겠다(i)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three-js/image-20211213205445311.png&quot; alt=&quot;image-20211213205445311&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;메소드&quot;&gt;메소드&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;메소드&lt;/th&gt;
      &lt;th&gt;문법&lt;/th&gt;
      &lt;th&gt;설명&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;text&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;정규식.text(문자열)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;일치 여부(Boolean) 반환&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;match&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;문자열.match(정규식)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;일치하는 문자의 배열(Array) 반환&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;replace&lt;/td&gt;
      &lt;td&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;문자열.replace(정규식, 대체문자)&lt;/code&gt;&lt;/td&gt;
      &lt;td&gt;일치하는 문자를 대체&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;ex) console.log(str.match(/문자열/gi))&lt;/p&gt;

&lt;h2 id=&quot;패턴표현&quot;&gt;패턴(표현)&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;패턴&lt;/th&gt;
      &lt;th&gt;설명&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;^ab&lt;/td&gt;
      &lt;td&gt;줄(Line) 시작에 있는 ab와 일치&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;ab&amp;amp;&lt;/td&gt;
      &lt;td&gt;줄(Line) 끝에 있는 ab와 일치&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;패턴표현-1&quot;&gt;패턴(표현)&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;패턴&lt;/th&gt;
      &lt;th&gt;설명&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;^ab&lt;/td&gt;
      &lt;td&gt;줄(Line) 시작에 있는 ab와 일치&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;ab&amp;amp;&lt;/td&gt;
      &lt;td&gt;줄(Line) 끝에 있는 ab와 일치&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;.&lt;/td&gt;
      &lt;td&gt;임의의 한 문자와 일치&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;a&amp;amp;verbar;b&lt;/td&gt;
      &lt;td&gt;a 또는 b와 일치&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;ab?&lt;/td&gt;
      &lt;td&gt;b가 없거나 b와 일치&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;{3}&lt;/td&gt;
      &lt;td&gt;3개 연속 일치&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;{3,}&lt;/td&gt;
      &lt;td&gt;3개 이상 연속 일치&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;{3,5}&lt;/td&gt;
      &lt;td&gt;3개 이상 5개 이하 연속 일치&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;\w&lt;/td&gt;
      &lt;td&gt;63개 문자(Word, 대소영문52개 + 숫자 10개 + _)에 일치&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;\b&lt;/td&gt;
      &lt;td&gt;63개 문자에 일치하지 않는 문자 경계&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;\d&lt;/td&gt;
      &lt;td&gt;숫자에 일치&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;\s&lt;/td&gt;
      &lt;td&gt;공백에 일치&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;예제 :&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;the frozen brown jumps fox
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;console.log(
	str.match(/\bf\w{1,}\b/g)
)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;결과&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;img src=&quot;images/2021-12-13-three-js/image-20211214204524886.png&quot; alt=&quot;image-20211214204524886&quot; /&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;=&amp;gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;f&lt;/code&gt;로 시작하는 것을 찾는다.&lt;/p&gt;

&lt;h2 id=&quot;typescript&quot;&gt;TypeScript&lt;/h2&gt;

&lt;p&gt;https://slides.com/woongjae/ts2021 이웅재 강사&lt;/p&gt;

&lt;dl&gt;
  &lt;dt&gt;&lt;strong&gt;TypeScript 란?&lt;/strong&gt;&lt;/dt&gt;
  &lt;dd&gt;
    &lt;p&gt;자바스크립트에 ‘타입’ 을 추가해서 확장시킨다.&lt;/p&gt;
  &lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;&lt;strong&gt;TypeScript 설치&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three-js/image-20211215131723023.png&quot; alt=&quot;image-20211215131723023&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nvm&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;https://github.com/coreybutler/nvm-windows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;TypeScript 컴파일러 설치&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;npm i typescript -g 후
    &lt;ul&gt;
      &lt;li&gt;node_modules/.bin/tsc 가 생긴다.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;vscode( 터미널(cmd)에서 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;code .&lt;/code&gt; 으로 바로 실행가능)&lt;/p&gt;

&lt;p&gt;새 폴더 생성 - vscode 실행 - 폴더 열기 - 파일명.ts만들기 - &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm init -y&lt;/code&gt; -&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npm i typescript -D&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;(-D 는 개발용으로 사용한다는 의미 정의)&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npx tsc --init&lt;/code&gt; : tsconfig.json 파일 생성.&lt;/p&gt;

&lt;p&gt;명령어  &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;npx tsc&lt;/code&gt;  실행하여 tsconfig.json형태로 실행되도록 명령어 입력.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[Tip]&lt;/strong&gt; ctrl+shift+p 를 통해 해당을 설치해야 터미널에서 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;code .&lt;/code&gt; 으로 vscode 열수 있다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three-js/image-20211215134728781.png&quot; alt=&quot;image-20211215134728781&quot; /&gt;&lt;/p&gt;

&lt;p&gt;TypeScript 프로그램 작성을 위해  제공되는 타입&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;number&lt;/code&gt; :&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;let 이름: number = 1; //ex)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;undefined &amp;amp; null&lt;/code&gt;:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;–strictNullChecks&lt;/strong&gt; 를 사용한다 기본적이로.&lt;/p&gt;

&lt;p&gt;Why? =&amp;gt; number에 null을 쓸 경우 오류가 나기 때문에 이를 방지하기위해,&lt;/p&gt;

&lt;p&gt;undefined와 null 즉, 자신에게만 사용 가능하도록 하는 것이다.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;never&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;never 타입은 모든 타입의 subtype 이며, 모든 타입에 할당 할 수 있다.&lt;/p&gt;

&lt;p&gt;하지만, never 에는 그 어떤 것도 할당할 수 없다.&lt;/p&gt;

&lt;p&gt;타입 스크립트의 타입 시스템&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;타입을 명시적으로 지정할 수 있다.&lt;/li&gt;
  &lt;li&gt;타입을 명시적으로 지정하지 않으면, 타입스크립트 컴파일러가 자동으로 타입을 &lt;strong&gt;추론&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;따라서,&lt;/p&gt;

&lt;dl&gt;
  &lt;dt&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nolmplicitAny&lt;/code&gt; 옵션&lt;/dt&gt;
  &lt;dd&gt;
    &lt;p&gt;옵션을 켜면  타입을 명시적으로 지정하지 않은 경우,&lt;/p&gt;
  &lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;타입스크립트가 추론 중 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;any&lt;/code&gt; 라고 판단하게 되면,&lt;/p&gt;

&lt;p&gt;컴파일 에러를 발생시켜&lt;/p&gt;

&lt;p&gt;명시적으로 지정하도록 유도한다&lt;/p&gt;

&lt;p&gt;※ 필자는 이부분에서 에러가 발생하였을때 굉장히 애를 먹었습니다..&lt;/p&gt;

&lt;p&gt;※  작성자와 사용자의 관점에서 각각 바라보는 시각이 다르기 때문에 이점을 신경쓰면 좋겠다 ※&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;images/2021-12-13-three-js/image-20211215200553234.png&quot; alt=&quot;image-20211215200553234&quot; /&gt;&lt;/p&gt;

&lt;p&gt;DOM API&lt;/p&gt;

&lt;p&gt;Document Object Model&lt;/p&gt;

&lt;p&gt;Html 에 들어있는 div,span,input 요소들을 의미 = DOM&lt;/p&gt;

&lt;p&gt;jsonplaceholder =&amp;gt; photo&lt;/p&gt;

&lt;p&gt;–&amp;gt; 12/17 four 로 이동.&lt;/p&gt;</content><author><name>Xogus Cho</name><email>xogus998@naver.com</email></author><summary type="html">홈페이지 만들기</summary></entry><entry><title type="html">11/29~12/3 2주차 워크시트!</title><link href="https://taehyunn.github.io//2%EC%A3%BC%EC%B0%A8-%EC%9B%8C%ED%81%AC%EC%8B%9C%ED%8A%B8!/" rel="alternate" type="text/html" title="11/29~12/3 2주차 워크시트!" /><published>2021-12-03T00:00:00+00:00</published><updated>2021-12-03T00:00:00+00:00</updated><id>https://taehyunn.github.io//2%EC%A3%BC%EC%B0%A8-%EC%9B%8C%ED%81%AC%EC%8B%9C%ED%8A%B8!</id><content type="html" xml:base="https://taehyunn.github.io//2%EC%A3%BC%EC%B0%A8-%EC%9B%8C%ED%81%AC%EC%8B%9C%ED%8A%B8!/">&lt;h1 id=&quot;웹-사이트-뼈대-만들기&quot;&gt;웹 사이트 뼈대 만들기&lt;/h1&gt;

&lt;h2 id=&quot;javascript&quot;&gt;JavaScript&lt;/h2&gt;

&lt;h3 id=&quot;javascript-1&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;JavaScript&lt;/code&gt;&lt;/h3&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;indexOf 함수
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;특정 값이 배열의 몇 번째 요소인지 반환&lt;/p&gt;

  &lt;p&gt;없을 시 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-1&lt;/code&gt; 반환&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;push-함수&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;push&lt;/code&gt; 함수&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;p&gt;배열에 요소를 삽입한다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;myArray&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[];&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;myArray&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;myArray&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;myArray&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;   &lt;span class=&quot;o&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;myArray&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;대입&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;myArray&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;길이는&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;

&lt;span class=&quot;nx&quot;&gt;myArray&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;myArray&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;myArray&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;conact--함수&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;conact &lt;/code&gt; 함수&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;p&gt;다른 배열을 이어붙인 배열을 반환&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;myNumberArray = [1,2,3,4]
myNumberArray = [0].concat(myNumberArray) 
var myNumberArray2 = mynuberArray.concat([0]);  형식도 가능.
console.log(myNumberArray)
[1,2,3,4] =&amp;gt; [0,1,2,3,4]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;for문&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;for&lt;/code&gt;문&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;strong&gt;형식 {초기화 : 조건 : 작업 후 처리}&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;for( var i=0; i&amp;lt;5; i++){
console.log(i);
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;실행순서&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;var i=0;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;5보다 작으므로 console.log(i) 실행. 출력.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;i++ 실행. 1로 상승.&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;결과&lt;/p&gt;

    &lt;pre&gt;&lt;code class=&quot;language-0&quot;&gt;0
1
2
3
4
&lt;/code&gt;&lt;/pre&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;배열을-for-문으로-다루기&quot;&gt;배열을 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;for&lt;/code&gt; 문으로 다루기&lt;/h3&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;var oddArray = [];
var evenArray = [];

for (var i = 10; i &amp;lt;= 20; i++) {
  if (i % 2 === 0) {
    evenArray.push(i);
  } else {
    oddArray.push(i);
  }
}

console.log(oddArray);
console.log(evenArray);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;evenArray에 넣어준다. if문 값을.&lt;/p&gt;

  &lt;p&gt;그 이외 나머지는 oddArray에 넣어준다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3 id=&quot;함수와-이벤트&quot;&gt;함수와 이벤트&lt;/h3&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;function insertThisTime () {
  var ulEl = document.querySelector(&quot;ul&quot;);
  var liEl = document.createElement(&quot;li&quot;);
  liEl.append(new Date());
  ulEl.append(liEl);
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;두개가 같은 코드 이다. 서식만 다를뿐.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;var insertThisTime = function () {
  var ulEl = document.querySelector(&quot;ul&quot;);
  var liEl = document.createElement(&quot;li&quot;);
  liEl.append(new Date());
  ulEl.append(liEl);
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;이벤트&quot;&gt;이벤트&lt;/h2&gt;

&lt;blockquote&gt;
  &lt;p&gt;특정 요소 클릭 시 이벤트&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;onclick=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;insertThisTime();&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;현 시각 기록&lt;span class=&quot;nt&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;ul&amp;gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
function insertThisTime () {
  var ulEl = document.querySelector(&quot;ul&quot;);
  var liEl = document.createElement(&quot;li&quot;);
  liEl.append(new Date());
  ulEl.append(liEl);
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;요소 로드 완료시 이벤트&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;body에 붙일 경우 페이지의 모든 요소들(이미지, js, css 파일 등) 로드 후 실행&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;body&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;onload=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;sayPageIsLoaded();&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;h1&amp;gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
function sayPageIsLoaded () {
  document.querySelector(&quot;h1&quot;).innerHTML = &quot;페이지 로드 완료!&quot;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;hr /&gt;

&lt;h3 id=&quot;팀-배정-프로그램-만들어보기&quot;&gt;팀 배정 프로그램 만들어보기&lt;/h3&gt;

&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;팀 배정&lt;span class=&quot;nt&quot;&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;table&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;td&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;colspan=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;3&quot;&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;not_assigned&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;1팀&lt;span class=&quot;nt&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;2팀&lt;span class=&quot;nt&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;3팀&lt;span class=&quot;nt&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;tr&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;button&amp;gt;&lt;/span&gt;배정&lt;span class=&quot;nt&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;ul&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;team_1&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;button&amp;gt;&lt;/span&gt;배정&lt;span class=&quot;nt&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;ul&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;team_2&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;td&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;button&amp;gt;&lt;/span&gt;배정&lt;span class=&quot;nt&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;nt&quot;&gt;&amp;lt;ul&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;id=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;team_3&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;nt&quot;&gt;&amp;lt;/td&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;/tr&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/table&amp;gt;&lt;/span&gt;
body { padding: 8px 24px; }
table { width: 400px; }
td {
  padding: 12px 16px;
  border: 1px solid gray;

}
ul { list-style: none; }
button {
  font-size: 1rem;
}
var members = [
  '손흥민', '김영권', '이승우', '기성용', '황희찬', 
  '황희조', '구자철', '이용', '조현우', '김승규',
  '이강인', '박주호', '문선민', '김민재', '황인범', 
  '이정협', '김인성', '구성윤', '장현수', '나상호'
];
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;배정되지 않은 멤버들 표시 함수&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;showNotAssigneds&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;membersString&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;''&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;members&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;nx&quot;&gt;membersString&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;members&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;members&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;membersString&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;s1&quot;&gt;#not_assigned&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;innerHTML&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;membersString&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;페이지 로드시 실행&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;body&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;onload=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;showNotAssigneds();&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;목록 앞에서부터 한 명씩 빼서 원하는 팀에 배정&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;assignMemberToTeam&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;teamNumber&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;members&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;member&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;members&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;];&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;member&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;members&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;splice&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;showNotAssigneds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;

  &lt;span class=&quot;kd&quot;&gt;var&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;liEl&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;li&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;liEl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;member&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;#team_&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;teamNumber&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;append&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;liEl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;버튼에 함수 실행 이벤트 등록&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;onclick=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;assignMemberToTeam(1)&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;배정&lt;span class=&quot;nt&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ... --&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;onclick=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;assignMemberToTeam(2)&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;배정&lt;span class=&quot;nt&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;&amp;lt;!-- ... --&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;button&lt;/span&gt; &lt;span class=&quot;na&quot;&gt;onclick=&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;assignMemberToTeam(3)&quot;&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;&amp;gt;&lt;/span&gt;배정&lt;span class=&quot;nt&quot;&gt;&amp;lt;/button&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;스타일-제어하기&quot;&gt;스타일 제어하기&lt;/h2&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;div&amp;gt;MY DIV&amp;lt;/div&amp;gt;
var divEl = document.querySelector(&quot;div&quot;); =&amp;gt; div
divEl.style.color = &quot;blue&quot;; =&amp;gt; blue
document.querySelector(&quot;div&quot;).style = &quot; red &quot; =&amp;gt; red 로 변경
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nx&quot;&gt;divEl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;backgroundColor&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;skyblue&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;배경&lt;/span&gt; 
&lt;span class=&quot;nx&quot;&gt;divEl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;padding&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;24px 36px&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;폭사이즈&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;divEl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;display&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;inline-block&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;반대는&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;block&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;divEl&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;borderRadius&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;12px&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;박스&lt;/span&gt;
&lt;span class=&quot;nx&quot;&gt;divE1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;style&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fontWeight&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;bold&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;글씨&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;html-요소의-클래스-다루기&quot;&gt;HTML 요소의 클래스 다루기&lt;/h2&gt;

&lt;div class=&quot;language-html highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nt&quot;&gt;&amp;lt;ul&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;span&amp;gt;&lt;/span&gt;국어&lt;span class=&quot;nt&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;span&amp;gt;&lt;/span&gt;수학&lt;span class=&quot;nt&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;span&amp;gt;&lt;/span&gt;사회&lt;span class=&quot;nt&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;span&amp;gt;&lt;/span&gt;과학&lt;span class=&quot;nt&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;&amp;lt;li&amp;gt;&amp;lt;span&amp;gt;&lt;/span&gt;체육&lt;span class=&quot;nt&quot;&gt;&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/ul&amp;gt;&lt;/span&gt;
  .highlighted span {
    background-color: yellowgreen;
  }
  .important span {
    font-weight: bold;
    color: blue;
  }
&lt;span class=&quot;nt&quot;&gt;&amp;lt;/style&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;클래스-값-지정&quot;&gt;클래스 값 지정&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;className&lt;/code&gt; 속성에 값 대입&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ul li:nth-child(3)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;className&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;highlighted&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ul li:nth-child(3)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;className&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;important&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ul li:nth-child(3)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;className&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;highlighted important&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;클래스-추가--제거&quot;&gt;클래스 추가 / 제거&lt;/h3&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;classList&lt;/code&gt;의 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;add&lt;/code&gt;, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;remove&lt;/code&gt; 사용&lt;/p&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ul li:nth-child(4)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;classList&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;highlighted&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ul li:nth-child(4)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;classList&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;important&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// 이미 있는 클래스는 추가되지 않음&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ul li:nth-child(4)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;classList&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;add&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;important&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;document&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;querySelector&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ul li:nth-child(3)&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;classList&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;remove&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;important&lt;/span&gt;&lt;span class=&quot;dl&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;p&gt;&lt;img src=&quot;/images/2021-12-03-2주차-워크시트!/image-20211126154928855.png&quot; alt=&quot;안나옴&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;last-practice&quot;&gt;Last practice&lt;/h3&gt;

&lt;p&gt;=&amp;gt; Part 04. 나만의 사진 포트폴리오 만들기 참조&lt;/p&gt;

&lt;h4 id=&quot;togglelike함수&quot;&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;toggleLike&lt;/code&gt;함수&lt;/h4&gt;

&lt;div class=&quot;language-javascript highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;toggleLike&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;idx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;my_info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;like&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;indexOf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;idx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;// 내가 좋아요하지 않은 사진일 때&lt;/span&gt;
      &lt;span class=&quot;nx&quot;&gt;my_info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;like&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;idx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt; 			&lt;span class=&quot;c1&quot;&gt;//my_info의 좋아요에 idx 를 푸쉬해서&lt;/span&gt;
      									&lt;span class=&quot;c1&quot;&gt;// 해제 된 상태 유지.&lt;/span&gt;
	&lt;span class=&quot;nx&quot;&gt;photos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;forEach&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;phto&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;     &lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
        &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;photo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;idx&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;===&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;idx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;  		&lt;span class=&quot;c1&quot;&gt;//  // → 좋아요로 바꿈&lt;/span&gt;
            &lt;span class=&quot;nx&quot;&gt;photo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;lieks&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;				&lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
        &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;

  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
		&lt;span class=&quot;nx&quot;&gt;my_info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;like&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;my_info&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;fillter&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kd&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;photo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
        	&lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;photo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;nx&quot;&gt;idx&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!==&lt;/span&gt; &lt;span class=&quot;nx&quot;&gt;idx&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;//&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// 내가 좋아요 한 사진일 때&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// → 좋아요 해제&lt;/span&gt;

  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

  &lt;span class=&quot;c1&quot;&gt;// 최종적용&lt;/span&gt;
  &lt;span class=&quot;nx&quot;&gt;showPhotos&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;firebase-호스팅&quot;&gt;Firebase 호스팅&lt;/h2&gt;

&lt;h3 id=&quot;웹-호스팅&quot;&gt;웹 호스팅&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;p&gt;웹 사이트를 배포할 수 있도록 인터넷 망에 연결된 서버의 일정 공간을 임대해주는 서비스&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;호스팅&lt;/code&gt; : 서버 임대 서비스
    &lt;ul&gt;
      &lt;li&gt;.html&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;, &lt;/code&gt;.css&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;, &lt;/code&gt;.js`, 이미지 등 정적 파일들을 업로드하여 외부에서 접근 가능하도록 함&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;firebase&quot;&gt;Firebase&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;p&gt;서버에 직접 구현해야 했던 기능들을 대신해주는 서비스&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
  &lt;li&gt;호스팅,데이터베이스,파일저장,로그인 등&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;firebase-준비&quot;&gt;Firebase 준비&lt;/h3&gt;

&lt;ul&gt;
  &lt;li&gt;Node.js 설치&lt;/li&gt;
&lt;/ul&gt;

&lt;hr /&gt;

&lt;h2 id=&quot;html-css-javascript-심화-학습&quot;&gt;HTML, CSS, JavaScript 심화 학습&lt;/h2&gt;

&lt;p&gt;main.js 파일을 만들고 본 코드에서 js 파일을 읽어올때는&lt;/p&gt;

&lt;p&gt;&amp;lt;script src = “”&amp;lt;/script&amp;gt;&lt;/p&gt;

&lt;p&gt;형식으로 쓴다.&lt;/p&gt;

&lt;p&gt;js 파일은 실행 시 Console 부분에 뜬다.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;console.log(' 내가 맘대로 입력')&lt;/code&gt;&lt;/p&gt;

  &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;콘솔&lt;/code&gt;에 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;로그&lt;/code&gt;를 작성한다. 라는 뜻&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;link rel =&quot;&quot; href=&quot;&quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;외부 문서를 가져와 연결할 때 사용.(대부분 CSS파일)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;rel : 가져올 문서와 관계 / href: 가져올 문서의 경로&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211129205827748.png&quot; alt=&quot;image-20211129205827748&quot; /&gt;&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;img src=&quot;./경로&quot; alt=&quot;&quot;&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;alt : 대체텍스트  ( 이미지가 출력하지 못할 시 알리고자 작성)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211129212337066-16381886386071.png&quot; alt=&quot;image-20211129212337066&quot; /&gt;&lt;/p&gt;

&lt;p&gt;../ (상위폴더로 올라가서 찾음)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211129213203225-16381891246322.png&quot; alt=&quot;image-20211129213203225&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;css&quot;&gt;CSS&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;p&gt;element.style은 css의 인라인 선언 방식으로 스타일이 삽입된다.&lt;/p&gt;

  &lt;p&gt;console 모드 (개발자도구)&lt;/p&gt;

  &lt;ul&gt;
    &lt;li&gt;codepen.io : 온라인에서 코드 작성 가능 사이트.(추천)&lt;/li&gt;
  &lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;선택자P{속성 : 값;}  =&amp;gt; color : blue;&lt;/p&gt;

&lt;h3 id=&quot;html&quot;&gt;html&lt;/h3&gt;

&lt;blockquote&gt;
  &lt;태그&gt; : 빈태그 -&amp;gt; 뒤에 &lt;/태그&gt;
  &lt;p&gt;가 없음 -&amp;gt; 빈 태그 뒤에 ‘/’ 를 붙이는 것이 좋다.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;ex) meta 태그&lt;/p&gt;

&lt;blockquote&gt;
  &lt;태그 속성=&quot;값&quot;&gt;내용&lt;/태그&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;span&gt;&lt;/span&gt;: 대표적인 인라인 요소!&lt;/p&gt;

&lt;p&gt;본질적으로 아무것도 나타내지 않는, 콘텐츠 영역을 설정하는 용도의 태그.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211130141503315-16382493064843.png&quot; alt=&quot;image-20211130141503315&quot; /&gt;&lt;/p&gt;

&lt;p&gt;div는 블록요소 span 태그는 인라인요소. 서로 상반됨.&lt;/p&gt;

&lt;p&gt;인라인 요소 = 글자 /  블록요소 = 상자 의 개념&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;a href=&quot;링크&quot;&amp;gt;클릭될 이름&amp;lt;/a&amp;gt; -&amp;gt; 클릭될 이름의 페이지로 이동. 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;target=”_blank” =&amp;gt; 새탭에서 연다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211130145144695-16382515069224.png&quot; alt=&quot;image-20211130145144695&quot; /&gt;&lt;/p&gt;

&lt;p&gt;radio 의 역할. 그리고 이름의 그룹은 같은 이릅으로 설정하면 ok가 되는것 이름이 다르면 안된다.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;table&amp;gt;&amp;lt;/table&amp;gt; -&amp;gt; 행과 열의 집합
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;태그 id=&quot;이름&quot;&gt;&lt;/태그&gt;
&lt;/blockquote&gt;

&lt;p&gt;-&amp;gt; Css에서는 “#”id  해주고 설정한다.&lt;/p&gt;

&lt;p&gt;script 요소에 defer 속성은, html 구조가 준비된 후(문서 분석 이후)에 JavaScript를 해석하겠다는 의미.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211130160518885-16382559207645.png&quot; alt=&quot;image-20211130160518885&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;복합 선택자&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;span class=&quot;ornage&quot;&amp;gt;오렌지&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;span.orange{  color: red;&lt;/p&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;로 선택한다. (= .orange 로 선택 가능)&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;ul &amp;gt; .orange {} : 클래스가 orange인 것을 찾는다. 단, ul의 자식요소여야 한다.&lt;/p&gt;

  &lt;p&gt;(기호는 ‘&amp;gt;’)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211130161347946-16382564294206.png&quot; alt=&quot;image-20211130161347946&quot; /&gt;&lt;/p&gt;

&lt;p&gt;.orange + li =&amp;gt; .orange를 선택된 후 그 아래 형제를 출력&lt;/p&gt;

&lt;p&gt;.orange ~li =&amp;gt; .orange를 선택된 후 그 아래 형제’들’ 모두 출력.&lt;/p&gt;

&lt;p&gt;a:hover {color:red;} :  해당요소에 마우스커서를 올려두면 색깔을 빨강으로 바꾸겟다.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&amp;lt;a href = &quot;링크&quot;&amp;gt;이름&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;blockquote&gt;
  &lt;p&gt;inherit -&amp;gt; 상속&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;.parent -&amp;gt; .child : 부모의 속성을 자식이 상속 가능.&lt;/p&gt;

&lt;p&gt;같은 클래스로 선언했을경우 나중에 작성된 색깔로 표시된다.&lt;/p&gt;

&lt;p&gt;!important 사용 시 색깔을 강제로 바꿀 수 있지만 사용하지 않는것을 추천한다.&lt;/p&gt;

&lt;p&gt;*{}:전체 선택자 	0점&lt;/p&gt;

&lt;p&gt;div{}:태그선택자	1점&lt;/p&gt;

&lt;p&gt;.hello{}: 클래스선택자	10점&lt;/p&gt;

&lt;p&gt;#hello{}:아이디 선택자	100점&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;width, heigh&lt;/code&gt;&lt;/p&gt;

    &lt;p&gt;값을 따로 넣지 않아도 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;auto&lt;/code&gt;:브라우저가 너비를 계산한다.&lt;/p&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;인라인 요소는 가로,세로 를 조절할 수 없다. (글자만 정의)&lt;/p&gt;

&lt;p&gt;width : 요소의 가로 너비&lt;/p&gt;

&lt;p&gt;height: 요소의 세로 너비      둘다 기본 속성은 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;auto&lt;/code&gt;이다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;단위&lt;/code&gt;
    &lt;ul&gt;
      &lt;li&gt;vw : viewport의 가로&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;margin : 상,하,좌,우 모두 적용이 된다(외부)&lt;/p&gt;

&lt;p&gt;상,좌/우,하 순서로 작성가능. or 상,우,하,좌 순서로 작성가능.(시계방향으로)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211130195302686-16382695836817.png&quot; alt=&quot;image-20211130195302686&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;padding : 요소의 내부여백(공간)을 지정하는 단축 속성.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211130200039306-16382700404458.png&quot; alt=&quot;image-20211130200039306&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;넘침 제어
    &lt;ul&gt;
      &lt;li&gt;overflow: hidden;  =&amp;gt; 부모보다 자식의 크기가 클경우 맞춰주는것&lt;/li&gt;
      &lt;li&gt;overflow: scroll; =&amp;gt; 스크롤 좌우, 위아래로 움직일 수 있는게 생긴다.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211130204845562-16382729267289.png&quot; alt=&quot;image-20211130204845562&quot; /&gt;&lt;/p&gt;

&lt;p&gt;넘치는게 없으면 auto 사용시 넘치는 부분에 해당해서 scroll 바가 생김.&lt;/p&gt;

&lt;p&gt;투명도 조절 명령어  = opacity&lt;/p&gt;

&lt;p&gt;배경화면 사이즈 조절 = background-size&lt;/p&gt;

&lt;p&gt;배경화면 반복 조절 = background-repeat : no-repeat;&lt;/p&gt;

&lt;p&gt;배경화면 위치 조절 = background-position: center;&lt;/p&gt;

&lt;p&gt;repeat-x / repeat-y = x축 반복 출력 , y 축 반복 출력&lt;/p&gt;

&lt;p&gt;화면 스크롤에 따라 이미지 위치가 상하로 이동한다 = background-attachment: scroll;&lt;/p&gt;

&lt;p&gt;패럴렉스 예제 만들기 ( css ) = 위 배경화면 관련 명령어들을 이용하여 홈페이지 배경은 고정/ 요소는 이동.&lt;/p&gt;

&lt;h4 id=&quot;배치&quot;&gt;배치&lt;/h4&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;position&lt;/code&gt; : 요소의 위치 지정 기준 설정 ( 음수 사용 가능)&lt;/p&gt;

&lt;p&gt;1.relative : 요소자신을 기준&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;absolute : 위치 상 부모 요소를 기준&lt;/li&gt;
  &lt;li&gt;fixed 뷰포트(브라우저)를 기준&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211201130800300-16383316821201.png&quot; alt=&quot;image-20211201130800300&quot; /&gt;&lt;/p&gt;

&lt;p&gt;relative 사용 시 그 자리는 시각적으로는 비어 있지만, 실제로는 존재함.&lt;/p&gt;

&lt;p&gt;위치가 이동한 것은 ‘허상’&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;position: static; &lt;/code&gt; : 기준이 되는 부모요소가 2개일 경우 한 곳에 지정하면 다른 부모의 relative를 설정해서 그										걸 기준으로 위치를 설정한다.&lt;/p&gt;

&lt;p&gt;z-index : 1; =&amp;gt; 요소 쌓임 설정 (가장 먼저 보임)&lt;/p&gt;

&lt;p&gt;position 속성의 값으로 absolute, fixed가 지정된 요소는, diisplay 속성이 block으로 변경됨.&lt;/p&gt;

&lt;p&gt;display:inline-flex; =&amp;gt; 인라인 단위로 끊어져서 flex container을 표현한다.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;container의 주 축을 설정 : flex-direction&lt;/li&gt;
  &lt;li&gt;-&amp;gt; row(행 좌-&amp;gt;우) 와 row-reverse( 행 우-&amp;gt;좌)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;flex-wrap&lt;/code&gt; : flex는 한줄에 모든 아이템을 표시하려 하는데 그러면 크기가 이상해질 수 있음.&lt;/p&gt;

&lt;p&gt;따라서 , flex-wrap을 이용해 줄바꿈 되게 하여 요소 본연의 크기를 지킴.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211201140533352-16383351346662.png&quot; alt=&quot;image-20211201140533352&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;align-content&lt;/code&gt; : 교차(수직)의 여러 줄 정렬 방법&lt;/p&gt;

&lt;p&gt;기타는 위와 같음.(활용도가 높지 않음)&lt;/p&gt;

&lt;p&gt;오히려  align-items를 많이 쓴다.&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;align-items&lt;/code&gt;:교차 축의 한 줄 정렬 방법&lt;/p&gt;

&lt;p&gt;flew-grow : 1; =&amp;gt; 1의 비율로 설정된다.&lt;/p&gt;

&lt;p&gt;전환 효과 : transition 명령어&lt;/p&gt;

&lt;p&gt;변환 효과 : tranform 명령어&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;변환&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;​			trnasform : rotate(45deg); =&amp;gt; 45도 만큼 회전을 한다.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211201152908712-16383401500283.png&quot; alt=&quot;image-20211201152908712&quot; /&gt;&lt;/p&gt;

&lt;p&gt;개인적으로 부모요소에 perspective 속성 사용이 선호된다.&lt;/p&gt;

&lt;p&gt;차이점 인지할것.&lt;/p&gt;

&lt;h4 id=&quot;js&quot;&gt;JS&lt;/h4&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211201172445551.png&quot; alt=&quot;image-20211201172445551&quot; /&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;객체 데이터&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;let user = {
name: 'asda',
age: 21,
isvlaid: true
};
closole.log(user.name); // asda  
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;배열 데이터&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;let fruits = ['apple'];
console.log(fruits[0]); // 'apple'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;변수&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;: 데이터를 저장하고 참조하는 데이터 / let 등.&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;let a = 2; //변수 let a 를 선언한다. 그후 2를 대입한다.
let b = 5;

console.log(a+b); // 7
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;함수&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;&lt;code class=&quot;language-//123&quot;&gt;//함수 선언
function 원하는이름() {
	//실행코드
	console.log(123);
}

//함수 호출
helloFunc(); // 123
&lt;/code&gt;&lt;/pre&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;function returnFunc() {
	return 123;
}
let a = returnFunc();

console.log(a); //123
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;매개변수&lt;/li&gt;
&lt;/ul&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;//함수 선언
function sum(a,b){ //a,b는 매개변수
	return a+b;
}
let a = sum(1,2); // 1과 2는 인수

console.log(a); // 3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211201193852604-16383551344904.png&quot; alt=&quot;image-20211201193852604&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/image-20211201201251600.png&quot; alt=&quot;image-20211201201251600&quot; /&gt;&lt;/p&gt;

&lt;p&gt;classList 같이 브라우저에서 정의되어 있는것을 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;DOM API&lt;/code&gt;라고 한다.&lt;/p&gt;

&lt;p&gt;함수 내에서 함수 밖으로 내보낸다. =&amp;gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;return&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;../images/2021-12-03-2주차-워크시트!/깃허브이미지테스트.png&quot; alt=&quot;깃허브이미지테스트&quot; /&gt;&lt;/p&gt;</content><author><name>Xogus Cho</name><email>xogus998@naver.com</email></author><summary type="html">웹 사이트 뼈대 만들기</summary></entry><entry><title type="html">첫 포스팅 TEST</title><link href="https://taehyunn.github.io//first/" rel="alternate" type="text/html" title="첫 포스팅 TEST" /><published>2021-11-25T00:00:00+00:00</published><updated>2021-11-25T00:00:00+00:00</updated><id>https://taehyunn.github.io//first</id><content type="html" xml:base="https://taehyunn.github.io//first/">&lt;h1 id=&quot;첫-블로그-개설일&quot;&gt;첫 블로그 개설일&lt;/h1&gt;

&lt;p&gt;파이팅!!&lt;/p&gt;</content><author><name>Xogus Cho</name><email>xogus998@naver.com</email></author><summary type="html">첫 블로그 개설일</summary></entry></feed>