<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.min.js"></script>
<script type="text/babel">
const a = () => {
console.log(`hello world!`);
};
a();
const wait = (ms) => {
return new Promise((r) => setTimeout(r, ms));
};
const hello = async () => {
await wait(1000);
console.log("world1");
await wait(1000);
console.log("world2");
await wait(1000);
console.log("world3");
};
hello();
</script>
테스트 브라우저 : IE11, 크롬, 엣지, 웨일 모두 잘됨 확인
다른 cdn을 사용했을시 IE11에서 오류가 발생 하였는데 위의 cdn 사용시 오류 없이 잘됨
'개발이야기 > Javascript' 카테고리의 다른 글
dayjs 날짜 일수 차이 계산 (0) | 2021.06.25 |
---|---|
자바스크립트 일반전화번호 / 휴대폰번호 / 이메일 유효성 체크 (0) | 2021.03.03 |
자바스크립트 뒤로 가기 막기 (0) | 2021.01.26 |
자바스크립트 내려쓰기 (0) | 2021.01.03 |
html에서 this 인자 전달 (0) | 2020.12.29 |