博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
bug探索_探索一流功能的力量
阅读量:2528 次
发布时间:2019-05-11

本文共 1674 字,大约阅读时间需要 5 分钟。

bug探索

was named one of the !

被评为

In JavaScript, functions are first-class objects, which means they can be:

在JavaScript中,函数是一流的对象,这意味着它们可以是:

  • stored in a variable, object, or array

    存储在变量,对象或数组中
  • passed as an argument to a function

    作为参数传递给函数
  • returned from a function

    从函数返回

存储功能 (Storing a function)

Functions can be stored in three ways:

函数可以通过三种方式存储:

  • store in a variable : let fn = function doSomething() {}

    存储在变量中: let fn = function doSomething() {}

  • store in an object : let obj = { doSomething : function(){} }

    存储在一个对象中: let obj = { doSomething : function(){} }

  • store in an array : arr.push(function doSomething() {})

    存储在数组中: arr.push(function doSomething() {})

In the first and third example, I used a named function expression.

在第一个和第三个示例中,我使用了一个命名函数表达式。

The function expression defines a function as part of a larger expression. The line of code doesn’t start with function .

函数表达式将函数定义为较大表达式的一部分。 代码行不是以function开头的。

用作参数 (Function as an argument)

In the next example, the function doSomething is sent as an argument to doAction().

在下一个示例中,函数doSomething作为参数发送给doAction()

doAction(function doSomething(){});

doSomething is a callback.

doSomething是一个回调。

A callback is a function passed as an argument to another function.

回调是作为参数传递给另一个函数的函数。

高阶函数 (Higher order functions)

A higher order function is a function that takes another function as an input, returns a function or does both.
高阶函数是将另一个函数作为输入,返回一个函数或同时执行两个函数的函数。

You can find more in the book.

您可以在“ 一书中找到更多信息。

For more on applying functional programming techniques in React take a look at .

有关在React中应用函数式编程技术的更多信息,请查看

Learn functional React, in a project-based way, with .

通过 ,以基于项目的方式学习功能性React

翻译自:

bug探索

转载地址:http://kcwzd.baihongyu.com/

你可能感兴趣的文章
当用updatepanel和scriptmanager时,弹出框
查看>>
如何破解百度云大文件下载限制
查看>>
冒泡排序
查看>>
react中<link>和<navlink>区别
查看>>
C# 生成随机数
查看>>
Psutil模块的应用
查看>>
session概述
查看>>
MATLAB 单变量函数一阶及N阶求导
查看>>
如何在网页端启动WinForm 程序
查看>>
[转载] Java并发编程:Lock
查看>>
MySQL之索引
查看>>
JAVA设计模式之单例模式
查看>>
优秀博客
查看>>
词法分析程序
查看>>
Java反射
查看>>
[ACM_模拟][ACM_数学] LA 2995 Image Is Everything [由6个视图计算立方体最大体积]
查看>>
1040 有几个PAT
查看>>
BZOJ 1412 [ZJOI2009]狼和羊的故事 | 网络流
查看>>
原型模式
查看>>
Hadoop RPC源码阅读-交互协议
查看>>