当前位置:网站首页>ES: Promise的基本用法
ES: Promise的基本用法
2022-08-02 16:59:00 【amadeus_liu2】
let myRandom=Math.floor(Math.random() * 10 );
var workIsDone=new Promise(
(resolve,reject) =>{
if(myRandom<5){
resolve("finished......")
}
else{
reject("ongoing......")
}
}
)
workIsDone.then(function(value) {
console.log("ok: "+value)
}, function(error) {
console.log("error: "+error);
});
边栏推荐
- SQL语句基础
- 智能合约安全——delegatecall (1)
- golang源码分析(3):thrift
- golang源码分析(9)调度
- Mysql——分组统计
- When Oracle analyzes the archive log content, it finds many nulls?
- nacos简单使用
- In the idea to create a web project _idea deployment of the web project
- 年轻人接棒大妈,金价跌回“4字头”,七夕迎黄金消费小热潮
- Coordinate knowledge in digital twin campus scenarios
猜你喜欢
随机推荐
【300+精选大厂面试题持续分享】大数据运维尖刀面试题专栏(十)
阿里云关系型数据库RDS是干嘛额?
navicat premium 15 下载安装详细教程
Antd-ProComponents中的EditableProTable无法在子行继续新增子子行的临时解决方案
Redis的介绍和使用
NoSQL之redis缓存雪崩、穿透、击穿概念解决办法
持续集成(四)Jenkins配置报警机制
再获权威认证!马上消费安逸花APP通过中国信通院“金融APP人脸识别安全能力评测”
MYSQL一站式学习,看完即学完
golang源码分析(6):sync.Mutex sync.RWMutex
When Oracle analyzes the archive log content, it finds many nulls?
工信部电子五所张志强:中国数据库行业发展趋势分析
数字孪生园区场景中的坐标知识
FPGA 20个例程篇:10.遍历DDR3内存颗粒读写循环校验
「全球数字经济大会」登陆 N 世界,融云提供通信云服务支持
用函数递归的方法解决汉诺塔问题
数字孪生园区场景中的坐标知识
Flink SQL搭建实时数仓DWD层
融云「 IM 进阶实战高手课」系列直播上线
Oracle 11 g rac finished patch, dbca new patches of SQL database also needs to perform?









