Check if Object is of type Set in JavaScript-Code Examples

Victor Talmacinschi

Check if Object is of type Set in JavaScript

JavaScript by Victor Talmacinschi β€’ June 21, 2022

const mySet = new Set(['🍎', '🍐', '🍊']);

// check if mySet is a Set
if (mySet instanceof Set) {
  console.log('mySet is a Set');
} else {
  console.log('mySet is not a Set');
}

0

19.286

Check if Object is of type Set in JavaScript

JavaScript by Victor Talmacinschi β€’ June 21, 2022

if (obj instanceof Set) {
  console.log("πŸ’―");
} else {
  console.log("πŸ™…πŸ½β€β™€οΈ");
}

0

19.286

Related JavaScript Queries

Latest JavaScript Queries

Explore code examples by categories