Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function diceCoefficient(value, alternative) {
var val = String(value).toLowerCase()
var alt = String(alternative).toLowerCase()
var left = val.length === 1 ? [val] : bigrams(val)
var right = alt.length === 1 ? [alt] : bigrams(alt)
var leftLength = left.length
var rightLength = right.length
var index = -1
var intersections = 0
var leftPair
var rightPair
var offset
while (++index < leftLength) {
leftPair = left[index]
offset = -1
while (++offset < rightLength) {
rightPair = right[offset]
if (leftPair === rightPair) {
function diceCoefficient(value, alternative) {
var val = String(value).toLowerCase()
var alt = String(alternative).toLowerCase()
var left = val.length === 1 ? [val] : bigrams(val)
var right = alt.length === 1 ? [alt] : bigrams(alt)
var leftLength = left.length
var rightLength = right.length
var index = -1
var intersections = 0
var leftPair
var rightPair
var offset
while (++index < leftLength) {
leftPair = left[index]
offset = -1
while (++offset < rightLength) {
rightPair = right[offset]