English 中文(简体)
1. 贾瓦·阿雷拉搜索方法
原标题:JavaScript Array Search Method

const temp = [27, 28, 30, 40, 42, 35, 30]; let high = temp.findLast(x => x > 40); actually I am self learning through W3School and the above code specially second line with (x => x > 40); is difficult to understand at this stage. May be it elaborate later in next chapters, So please can anyone tell me what it is? And how it works?

我没有尝试过。 我正在学习,我有粗略的想法,那就是,它是一种arrow的 function!

问题回答

法典:

const temp = [27, 28, 30, 40, 42, 35, 30];
let high = temp.findLast(x => x > 40);
  1. 页: 1 每个要素中包含7项内容,其类型数值为:

  2. In the second line there is the creation of a variable that will later receive a single number that is the result of the following code sentence temp.findLast(x => x > 40);

  3. temp.findLast() will traverse the temp array in reverse order (starting from 30, 35... up to 27) and will return the first element tested that satisfy the true condition of the callback x => x > 40 passed by parameter;

a) 如果在阵列开始时增加一个价值45的元件,你就会看到,<代码>高将保持42个,因为有42个是“顶”()”第1个元件,由“呼号”回来。

b) The iteration of the findLast function is interrupted as soon as it receives the first number greater than or equal to 40 in reverse order, that is, there will no longer be any processing resources being used;

c) 如无<代码>true > 状况由questback退回,这意味着find Last(x =>x > 40)将完全通过<代码>temp阵列,并将返回un specified。 页: 1

文件:https://developer.mozilla.org/en-US/docs/Web/Java/Reference/Global_Objects/Array/findLast





相关问题
Search field with Thickbox issue

i have a search form which is shown with Thickbox inside an iframe. the problem is.. that after i click "search" the result page is shown inside the same iframe! and i want it to be shown in the main ...

Will an incomplete google sitemap hurt my search ranking?

If I submit a sitemap.xml which does not contain all of the pages of my site, will this affect my search ranking? For example: If my sitemap only contained pages that had been created in the last ...

speeding up windows file search with C#

i made a program that search logical drives to find a specific file .if user type file name an click search button , searching begins , but i don t know how to stop searching in the middle of process....

JQuery/MVC Search Issue

I have inherited a piece of work where the entry screen shows a summary of 20 calculated variables. E.g. Var A (250), Var B (79). Clicking on any of these links takes the user to a view with a ...

Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Search by using the keyboard in a list/grid - algorithm

I need to implement a custom search in a grid and I would like to find some user interface guidelines that explain the standard way to implement it. I mean this kind of search that is initiated by ...

Embed Google/ Yahoo search into a web site or build your own

I am looking for an opinion on the whether to use Google custom search, Yahoo search builder or build my own for web projects (no more than 100 pages of content). If I should build my own - do you ...