Javascript Snippets
$9.99
Minimum price
$19.99
Suggested price

Javascript Snippets

Secret Code Snippets used by Powerful Developers to create Innovative Apps

About the Book

This book is for anyone with a basic working understanding of JS.

 

It covers 9 chapters with innovative and interesting ways of solving common situations when working with Arrays, Objects, NodeJS, Functions, Browser and more.

 

The idea is for you to also use some of the snippets as plug and play functions in your projects.

 

Why learn in this way ? 

 

Javascript is one of the most versatile and powerful programming languages, learning the basics and using libraries like Jquery is really easy, however most of the time the solutions to the problems we face might be coded in a simpler and more efficient way.

 

This book serves as a reference guide providing code snippets written in an efficient way, by studying each of them, and even customizing some of the snippets to better suit your project you will get in the habit of writing code like a god.

 

If you really want to develop a mindset which allows you to code in a precise and fast way, then there’s no escape. You must understand the idea behind each snippet and implement it on a project, by having the experience and solving all the challenges you face you will become a successful developer.

Check out other books from the author:

Javascript Snippets

Appwrite Up and Running

Front End Developer Interview Questions

ReactJS Documentation

Backend Developer Interview Questions

VueJS Documentation

React Redux Documentation

DevOPs

Data Science Workflow for Beginners

  • Share this book

  • Feedback

    You must own a copy of this Book to access the forums

    Email the Author(s)

About the Author

Alejandro Garcia
A.J. García

Hey, A.J here.


I started my coding career back in 2003. Lately I've been involved a lot in Javascript for frontend and the bakcend.


I would love passing along to you some of the experiences and challenges I've faced over the years.


Please feel free to reach out, provide some feedback, I really hope you get to enjoy the books!




Bundles that include this book

$74.92
Suggested Price
$19.99
Bundle Price

Table of Contents

  • Introduction
    • The Unique Advantage this Book will allow you to unleash
    • Who is this book for ?
    • What is covered in this book ?
  • Chapter 1: Array related snippets
    • all
    • allEqual
    • any
    • compact
    • difference
    • drop
    • dropRight
    • everyNth
    • filterNonUnique
    • findLast
    • head
    • includesAll
    • includesAny
    • initial
    • last
    • maxN
    • minN
    • none
    • nthElement
    • offset
    • reject
    • sample
    • similarity
    • tail
    • take
    • union
    • uniqueElements
    • without
    • arrayToCSV
    • bifurcate
    • bifurcateBy
    • chunk
    • chunkIntoN
    • countBy
    • countOccurrences
    • deepFlatten
    • differenceBy
    • differenceWith
    • dropRightWhile
    • dropWhile
    • filterNonUniqueBy
    • findLastIndex
    • flatten
    • forEachRight
    • frequencies
    • groupBy
    • haveSameContents
    • indexOfAll
    • initialize2DArray
    • initializeArrayWithRange
    • initializeArrayWithRangeRight
    • initializeArrayWithValues
    • initializeNDArray
    • intersection
    • intersectionBy
    • intersectionWith
    • isContainedIn
    • isSorted
    • join
    • longestItem
    • mapObject
    • mostFrequent
    • normalizeLineEndings
    • partition
    • pull
    • reduceSuccessive
    • reduceWhich
    • reducedFilter
    • remove
    • sampleSize
    • shank
    • shuffle
    • sortedIndex
    • sortedIndexBy
    • sortedLastIndex
    • sortedLastIndexBy
    • stableSort
    • symmetricDifference
    • symmetricDifferenceBy
    • symmetricDifferenceWith
    • takeRight
    • takeRightWhile
    • takeWhile
    • toHash
    • unionBy
    • unionWith
    • uniqueElementsBy
    • uniqueElementsByRight
    • uniqueSymmetricDifference
    • unzip
    • xProd
    • zip
    • zipObject
    • JSONtoCSV
    • permutations
    • pullAtIndex
    • pullAtValue
    • pullBy
    • unzipWith
    • weightedSample
    • zipWith
  • Chapter 2: Browser related snippets
    • createElement
    • currentURL
    • getImages
    • getBaseURL
    • getStyle
    • hasClass
    • hide
    • insertAfter
    • insertBefore
    • isBrowserTabFocused
    • nodeListToArray
    • redirect
    • setStyle
    • show
    • toggleClass
    • UUIDGeneratorBrowser
    • arrayToHtmlList
    • bottomVisible
    • detectDeviceType
    • elementContains
    • formToObject
    • getScrollPosition
    • getURLParameters
    • httpDelete
    • httpGet
    • httpPost
    • httpPut
    • httpsRedirect
    • isBrowser
    • off
    • on
    • parseCookie
    • prefersDarkColorScheme
    • prefersLightColorScheme
    • prefix
    • recordAnimationFrames
    • scrollToTop
    • serializeCookie
    • serializeForm
    • smoothScroll
    • supportsTouchEvents
  • Chapter 3: Date related snippets
    • dayOfYear
    • getMeridiemSuffixOfInteger
    • isAfterDate
    • isBeforeDate
    • isLeapYear
    • isSameDate
    • isWeekday
    • isWeekend
    • maxDate
    • minDate
    • getColonTimeFromDate
    • formatDuration
    • getDaysDiffBetweenDates
    • tomorrow
    • yesterday
  • Chapter 4: Function related snippets
    • checkProp
    • functionName
    • negate
    • nthArg
    • timeTaken
    • unary
    • ary
    • attempt
    • bind
    • bindKey
    • call
    • chainAsync
    • collectInto
    • compose
    • composeRight
    • converge
    • curry
    • debounce
    • defer
    • delay
    • flip
    • hz
    • mostPerformant
    • once
    • over
    • overArgs
    • partial
    • partialRight
    • pipeAsyncFunctions
    • pipeFunctions
    • promisify
    • rearg
    • runPromisesInSeries
    • sleep
    • spreadOver
    • times
    • uncurry
    • unfold
    • when
    • throttle
  • Chapter 5: Math related snippets
    • accumulate
    • approximatelyEqual
    • average
    • celsiusToFahrenheit
    • clampNumber
    • digitize
    • degreesToRads
    • distance
    • factorial
    • fahrenheitToCelsius
    • fibonacci
    • gcd
    • inRange
    • isDivisible
    • isEven
    • isNegativeZero
    • isOdd
    • isPowerOfTwo
    • isPrime
    • lcm
    • mapNumRange
    • maxBy
    • midpoint
    • minBy
    • powerset
    • radsToDegrees
    • randomHexColorCode
    • randomIntegerInRange
    • randomNumberInRange
    • sum
    • toDecimalMark
    • toSafeInteger
    • vectorAngle
    • vectorDistance
    • averageBy
    • binomialCoefficient
    • geometricProgression
    • hammingDistance
    • median
    • percentile
    • primes
    • randomIntArrayInRange
    • round
    • sdbm
    • standardDeviation
    • sumBy
    • sumPower
    • toCurrency
    • toOrdinalSuffix
    • validateNumber
    • luhnCheck
  • Chapter 6: Node related snippets
    • atob
    • btoa
    • createDirIfNotExists
    • untildify
    • readFileLines
    • JSONToFile
    • colorize
    • UUIDGeneratorNode
    • hasFlags
    • hashNode
    • isDuplexStream
    • isReadableStream
    • isStream
    • isTravisCI
    • isWritableStream
    • atob
    • btoa
    • createDirIfNotExists
    • readFileLines
    • untildify
    • JSONToFile
    • UUIDGeneratorNode
    • colorize
    • hasFlags
    • hashNode
    • isDuplexStream
    • isReadableStream
    • isStream
    • isTravisCI
    • isWritableStream
  • Chapter 7: Object related snippets
    • objectFromPairs
    • objectToEntries
    • objectToPairs
    • shallowClone
    • bindAll
    • deepClone
    • deepFreeze
    • deepGet
    • defaults
    • dig
    • findKey
    • findLastKey
    • flattenObject
    • forOwn
    • forOwnRight
    • functions
    • get
    • hasKey
    • invertKeyValues
    • lowercaseKeys
    • mapKeys
    • mapValues
    • matches
    • matchesWith
    • merge
    • nest
    • objectToQueryString
    • omit
    • omitBy
    • orderBy
    • pick
    • pickBy
    • renameKeys
    • size
    • toPairs
    • transform
    • truthCheckCollection
    • deepMapKeys
    • equals
    • unflattenObject
  • Chapter 8: Strings related snippets
    • byteSize
    • compactWhitespace
    • containsWhitespace
    • indentString
    • isLowerCase
    • isUpperCase
    • mapString
    • pad
    • reverseString
    • sortCharactersInString
    • splitLines
    • stripHTMLTags
    • truncateString
    • unescapeHTML
    • CSVToArray
    • RGBToHex
    • capitalize
    • capitalizeEveryWord
    • decapitalize
    • escapeHTML
    • escapeRegExp
    • extendHex
    • fromCamelCase
    • isAbsoluteURL
    • isAnagram
    • mask
    • palindrome
    • pluralize
    • removeNonASCII
    • toCamelCase
    • toKebabCase
    • toSnakeCase
    • toTitleCase
    • words
    • yesNo
    • CSVToJSON
    • URLJoin
    • hexToRGB
    • prettyBytes
    • stringPermutations
  • Chapter 9: Type related snippets
    • castArray
    • coalesce
    • getType
    • is
    • isBoolean
    • isEmpty
    • isFunction
    • isNil
    • isNull
    • isNumber
    • isObject
    • isObjectLike
    • isString
    • isSymbol
    • isUndefined
    • cloneRegExp
    • coalesceFactory
    • isArrayLike
    • isPlainObject
    • isPrimitive
    • isPromiseLike
    • isValidJSON
  • Bonus Projects
    • Ecommerce Customer Satisfaction Project
    • The data to work with
    • The requirements
    • Let’s build our script
  • Keep Exploring and Coding

Authors have earned$9,690,775writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.

Learn more about writing on Leanpub

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub