jsMomentum with VanillaJS
less than 1 minute read
javascript로 momentum만들기
목적: jquery만 쓰는것에 물들어 있어서 javascript로 직접 코딩하는것에 익숙해지기위해
기능: todoList/날씨/시계
알게된점:
- const, let
- const 변하지 않는 값
- let 변하는 값
→ 처음 const, let을 써볼때에는 const를 사용하길 권장
- `` 백틱
- console.log(hello ${name} haha
);
- 코드짜는순서
- JSON.parse() / JSON.stringify()
- JSON.parse() : string 객체를 json객체로 변환
- JSON.stringify() : json객체를 string객체로 변환 / javascript값을 문자열로 반환할때
처음 접한 것
- 날씨위치정보 api(https://openweathermap.org/)
- 개발자도구/Application/Storage/Key,Value
위치 정보 latitude, longitude를 가져와야 하는데 하나만 가져와서 애를 먹었다. 콘솔에도 값이 하나만 나오고..
-> Local Strorage에 값이 하나만 저장되어 있어서 새로고침을 해도 안나왔/ 값을 삭제하니까 나옴
결과물
https://ha0ha0.github.io/jsMomentum/