codecademy quiz——JavaScript Promise
Evernote Export
- What is the fulfilled value of Promise.all()?
A Promise
An object
An array- What is value of the argument that is passed to the onReject()?
‘success value’
reason
undefined- True or False: The .then() method returns a Promise.
False
True- How many parameters does a Promise constructor take?
2
1
3- What value is printed to the console?
Promise
Object
Number
String- Which one of the following is NOT a state that a Promise resolves to?
Rejected
Fulfilled
Undefined
Pending- What state will this promise be in after 0 seconds?
Fulfilled
Rejected
Pending- What will be printed to the console after running the code provided?
- Which of the executor function’s parameter is called if the asynchronous task completes successfully?
function1
function2
function1 or function2- True or False: promise1 and promise2 both produce the same output.
False
Truecodecademy quiz——JavaScript Promise的更多相关文章
- [Javascript] Promise
Promise 代表着一个异步操作,这个异步操作现在尚未完成,但在将来某刻会被完成. Promise 有三种状态 pending : 初始的状态,尚未知道结果 fulfilled : 代表操作成功 r ...
- Javascript Promise 学习笔记
1. 定义:Promise是抽象异步处理对象以及对其进行各种操作的组件,它把异步处理对象和异步处理规则采用统一的接口进行规范化. 2. ES6 Promises 标准中定义的API: ...
- 【译】JavaScript Promise API
原文地址:JavaScript Promise API 在 JavaScript 中,同步的代码更容易书写和 debug,但是有时候出于性能考虑,我们会写一些异步的代码(代替同步代码).思考这样一个场 ...
- JavaScript Promise:去而复返
原文:http://www.html5rocks.com/en/tutorials/es6/promises/ 作者:Jake Archibald 翻译:Amio 女士们先生们,请准备好迎接 Web ...
- javaScript Promise 入门
Promise是JavaScript的异步编程模式,为繁重的异步回调带来了福音. 一直以来,JavaScript处理异步都是以callback的方式,假设需要进行一个异步队列,执行起来如下: anim ...
- JavaScript Promise异步实现章节的下载显示
Links: JavaScript Promise:简介 1.一章一章顺序地下载显示下载显示 使用Array.reduce()和Promise.resolve()将各章的下载及显示作为整体串联起来. ...
- codecademy课程笔记——JavaScript Promise
Promise是一种表示异步操作最终的结果的对象,一个Promise对象有三种状态 Pending: 初始状态 ,操作还未完成 Fullfilled:操作成功完成,且这个promise现在有一个r ...
- Javascript - Promise学习笔记
最近工作轻松了点,想起了以前总是看到的一个单词promise,于是耐心下来学习了一下. 一:Promise是什么?为什么会有这个东西? 首先说明,Promise是为了解决javascript异步编 ...
- Javascript Promise入门
是什么? https://www.promisejs.org/ What is a promise? The core idea behind promises is that a promise r ...
随机推荐
- Select文字居右显示
使用text-align: right;不起作用,应当使用direction: rtl;
- 02 Redis关闭服务报错---(error) ERR Errors trying to SHUTDOWN. Check logs.
127.0.0.1:6379> shutdown (error) ERR Errors trying to SHUTDOWN. Check logs. 1.在redis.conf中修改日志文件的 ...
- 使用HttpClient和WebRequest时POST一个对象的写法
[一]步骤: 1)将对象转化为Json字符串. 2)将Json字符串编码为byte数组. 3)设置传输对象(WebRequest或者HttpClient)的ContentType是"appl ...
- 在centos7下安装.net core
在这里记录下安装的过程: 一开始需要去官网下载centos相关的dotnetcore的sdk 上传到linux,解压,发现需要安装libunwind, 安装libunwind:yum install ...
- day14 带参装饰器、迭代器、生成器
""" 今日内容: 1.带参装饰器及warps 2.迭代器 3.生成器 """ """ # 一.带参装饰器及w ...
- C#基础之Assembly
一直以来,我们都在用C#编写程序,编写程序的时候,我们用到继承.多态.接口以及泛型,我们也都明白子类可以继承抽象类,并能够重写父类的抽象方法,可是大家是否想过,如下几个问题: 1.凡树必有根和叶,类的 ...
- 手把手教你写vue插件并发布(一)
vue的插件开发 这篇文章较长,需要一定的阅读时间.这里有一份改善版本的插件笔记,在一个项目下完成开发.测试.发布的全过程.https://www.cnblogs.com/adouwt/p/96555 ...
- 最简单有效的关于linux下配置Git操作免登录ssh公钥
ssh-keygen -t rsa -b 4096 -C “someone@xxx.com” 然后回车三连击… 进入目录(执行cd ~/.ssh),可以看到当前目录下多出两个文件 id_rsa.pub ...
- Visual Studio 2015中 没有“安装和部署”的解决方法
使用Visual Studio 2015 Community新建项目,在已安装模板中的“其它项目类型”下未找到“安装和部署”选项.在微软官网下载 Microsoft Visual Studio 201 ...
- C#中用ILMerge合并DLL和exe文件成一个exe文件或者DLL
ILMerge是一个将多个.NET程序集合并到一个程序集中的实用程序.它既可以作为 开源使用,也可以作为NuGet包使用. 如果您在使用它时遇到任何问题,请与我们联系.(mbarnett _at_ ...