SniperJs
CtrlK
  • SniperJS Intro
  • Getting Started
  • Selector
    • Handling NodeLists & HTMLCollection in Regular JavaScript vs Sniper.js
    • Chaining
  • CSS Classes
  • SniperJs css()
  • Toggle an Action
  • onScroll
  • hide()
  • show()
  • hasValue()
  • toFirst()
  • toLast()
  • append()
  • createElement()
  • onPageLoad()
  • hasAtrr()
  • scrollTo()
  • scrollToTop()
  • scrollToBottom()
  • serialise()
  • before()
  • after()
  • Event Listener
  • Getters & Setters
    • Get Content and Attributes
    • Set Content and Attributes
    • Sniper attr()
    • removeAttr()
    • source()
    • Width & Height
  • String Methods
    • trimStart
    • trimEnd
    • capitalizeFirstLetters
      • capitalizeFirstLetter
    • truncate
  • Location
    • queryObject
  • window
    • onScroll
  • utils
    • mediaQuery
    • getYears
    • getMonths
    • getWeekDays
    • commarize
    • isJsonString
    • objIsEmpty
    • isObject
    • insertTextSeparator
    • isIterable
    • getRandomInt
    • isValidEmail
    • Case Conversions
      • camelToKebab
      • camelToSnake
      • camelToPascal
      • snakeToCamel
      • snakeToKebab
      • snakeToPascal
      • kebabToCamel
      • kebabToPascal
      • kebabToSnake
      • pascalToCamel
      • pascalToSnake
      • pascalToKebab
    • swapElements
    • debounce
    • die
  • AJAX
    • load()
    • Nexus
      • Creating an Instance
      • Performing Requests
      • Handling Errors
      • Features Breakdown
  • Storage
    • localStorage
    • sessionStorage
Powered by GitBook
On this page
  1. utils

objIsEmpty

This function checks whether a given JavaScript object is empty.

Parameters

  • obj: The object to be examined.

Returns

  • boolean: Returns true if the object is empty, and false otherwise.

Examples

const emptyObj = {};
console.log(objIsEmpty(emptyObj)); // Output: true

const nonEmptyObj = { key: 'value' };
console.log(objIsEmpty(nonEmptyObj)); // Output: false

PreviousisJsonStringNextisObject

Last updated 7 months ago