Odnaleźć
// app.js
const data = [20, 18, 15, 10, 9];
let found = data.find(element => element < 12);
console.log(found);
Comfortable Caiman
// app.js
const data = [20, 18, 15, 10, 9];
let found = data.find(element => element < 12);
console.log(found);
/* ~/c/user/desktop */
find -name *.py
will find all the files with the format .py inside the desktop folder
let found_user = response.data.find(acc=>{ //found_user is always undefined
return acc.username == user_to_find;
})
let found_user = response.data.find(acc=> ( //found_user is always undefined
acc.username === user_to_find;
))
def get_data_from_text_file(file):
# declare an empty list for the data
data = []
# get the data line-by-line using os.open()
for line in open(file, encoding="utf8", errors='ignore'):
# find a specific string contained the line string
if line.find("procedure") != -1:
# append each line of data to the list
data += [ str(line) ]
# return the list of data
return data
let numbers = [1, 2, 3, 4, 5];
console.log(numbers.find(e => e % 2 == 0));
Code language: JavaScript (javascript)