# isWeakSet

# Description

检查 value 是否是 WeakSet 对象。

# Params

value

# Return

Boolean

# Depend

import getTag from './.internal/getTag.js'
import isObjectLike from './isObjectLike.js'

getTag 源码分析

isObjectLike 源码分析

# Code

function isWeakSet(value) {
  return isObjectLike(value) && getTag(value) == '[object WeakSet]'
}

# Analyze

isWeakMap 基本类似,不再赘述

# Example

isWeakSet(new WeakSet)
// => true

isWeakSet(new Set)
// => false