Mozilla
Syntax
arr.unshift(element);
push가 배열의 뒤에 요소를 추가한다면, unshift는 배열의 앞에 요소를 추가한다. python의 deque에서 appendleft와 같다.
Example
<button onClick={() => { let newTitle = [...title]; newTitle.unshift(inputValue); setTitle(newTitle); }}>글 등록</button>