Tabnine Logo For Javascript
Array.flatten
Code IndexAdd Tabnine to your IDE (free)

How to use
flatten
function
in
Array

Best JavaScript code snippets using builtins.Array.flatten(Showing top 2 results out of 315)

origin: CapacitorSet/box-js

folders
  .filter(item => {
    const ret = fs.statSync(item).isDirectory();
    if (!ret)
      log("warn", `Ignoring argument "${item}" because it is not a directory`);
    return ret;
  })
  .map(path => ({root: path, files: walk(path)}))
  .map(({root, files}) => files.map(file => root + "/" + file).concat(root))
  .flatten()
  .filter(item => fs.statSync(item).isDirectory())
origin: CapacitorSet/box-js

folders
    .filter(item => {
      if (!fs.existsSync(item + "/urls.json")) {
        log("verb", `URL collection: discarding ${item} because it doesn't contain urls.json`);
        return false;
      }
      log("debug", `URL collection: folder ${item} is valid.`);
      return true;
    })
    .map(item => JSON.parse(fs.readFileSync(item + "/urls.json")))
    .flatten()
    .uniqueStrings()
builtins(MDN)Arrayflatten

Most used builtins functions

  • Console.log
  • Console.error
  • Promise.then
    Attaches callbacks for the resolution and/or rejection of the Promise.
  • Promise.catch
    Attaches a callback for only the rejection of the Promise.
  • Array.push
    Appends new elements to an array, and returns the new length of the array.
  • Array.length,
  • Array.map,
  • String.indexOf,
  • fetch,
  • Window.location,
  • Window.addEventListener,
  • ObjectConstructor.keys,
  • Array.forEach,
  • Location.reload,
  • Response.status,
  • Navigator.serviceWorker,
  • ServiceWorkerContainer.register,
  • ServiceWorkerRegistration.installing,
  • ServiceWorkerContainer.controller

Popular in JavaScript

  • mkdirp
    Recursively mkdir, like `mkdir -p`
  • yargs
    yargs the modern, pirate-themed, successor to optimist.
  • commander
    the complete solution for node.js command-line programs
  • colors
    get colors in your node.js console
  • readable-stream
    Streams3, a user-land copy of the stream library from Node.js
  • winston
    A logger for just about everything.
  • moment
    Parse, validate, manipulate, and display dates
  • node-fetch
    A light-weight module that brings window.fetch to node.js
  • handlebars
    Handlebars provides the power necessary to let you build semantic templates effectively with no frustration
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now