FLAVVS
BlogSoftwareExploitsCVEsAbout
Blog
Software
Exploits
CVEs
About
Published on
Sunday, January 22, 2023

Bouncer Pattern

Authors
  • avatar
    Name
    Christoph Diehl
    Twitter
    @posidron
function transform_data(raw_data) {
  // Check if no data
  if (!raw_data) {
    return []
  }
  // Check for specific case
  if (raw_data.length == 1) {
    return []
  }
  // Actual function code goes here
  return raw_data.map((item) => item)
}

Tags

javascriptbasics

Previous Article

Pure Functions in JavaScript

Next Article

RAM disk on Windows
← Back to the blog
mailgithubfacebookyoutubelinkedintwitter
Christoph Diehl
•
© 2024
•
Flavvs