hook/js

https://ko.reactjs.org/docs/hooks-intro.html
https://nomadcoders.co/react-hooks-introduction/lobby
https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/Variables

hooks

const useTitle = (initialTitle)=>{
	const [title,setTitle] = useState(initialTitle)
    const updateTitle = ()=>{
    	const htmlTitle = document.querySelector("title");
        htmlTitle.innerText = title; 
    }
    
    return setTitle;

}
const App = ()=>{
	const titleUpdater = useTitle("Loading...")
    return(
    <div className="App">
    	<div>Hi</div>
    </div>
    )

}

js

variables

메모리 code data stack heap

primitive => data stack
object => heap

variable 변수(let/const) - 값 저장소

선언- 할당- 재할당

naming 의미있게 구체적으로 변수를 만들 것 / 중요한 것을 먼저

escape expression
\n \t
template literal

false 값 = 0, "",null, undefined, NaN
true 값 = 나머지, {}, [] ....

https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Boolean

Boolean

null(타입 object) vs undefined (타입 undefined)

object는 key 와 value 로 이루어짐

primitive(value) object(reference)

좋은 웹페이지 즐겨찾기