성공 / 실패 판정 기계
성공 / 실패의 경우에 맞춰 각각 다른 코드 실행 가능
let 프로미스 = new Promise(function(resolve, reject){
let sum = 1 + 1;
resolve(sum);
//성공 판정
//파라미터로 sum의 결과값을 성공일 경우 실행할 코드에 전달할 수 있다.
reject();
//실패 판정
})
프로미스.then(function(a) {
//프로미스가 성공일 경우 실행할 코드
console.log(a); // 2;
}).catch(function() {
//프로미스가 실패일 경우 실행할 코드
console.log('실패했쪄염ㅠㅠ');
})
img태그가 로드가 성공하면 콘솔창에 '성공', 실패하면 '실패'가 뜨게 된다.
//html
<img id="test" src="https://codingapple1.github.io/kona.jpg">
//js
let promise = new Promise(function(resolve, reject){
const img = document.querySelector('#test');
img.addEventListener('load', function(){
resolve();
})
img.addEventListener('error', function(){
reject();
})
});
promise.then(function(){
console.log('성공');
}).catch(function(){
console.log('실패');
});

My friends recommended that I try https://www.tenderbang.com/gay-hookup.html, a casual hookup site, so I decided to give it a go. The profiles were engaging and the messaging was straightforward, full of playful banter that quickly became more intimate. I ended up connecting with someone local, and our chats quickly became flirty and hot without any awkwardness. It was refreshing to find a space where people were honest about what they wanted. This made the whole experience feel smooth, spontaneous and surprisingly satisfying.