“trouver” Réponses codées

Trouver

// app.js

const data = [20, 18, 15, 10, 9];

let found = data.find(element => element < 12);

console.log(found);
Comfortable Caiman

trouver

/* ~/c/user/desktop  */ 
find -name *.py
will find all the files with the format .py inside the desktop folder 
Mero

trouver

    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;
    ))
Sore Snake

trouver

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
Beautiful Bee

trouver

let numbers = [1, 2, 3, 4, 5];

console.log(numbers.find(e => e % 2 == 0));
Code language: JavaScript (javascript)
Tense Thrush

Réponses similaires à “trouver”

Questions similaires à “trouver”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code