Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isArrayLike false detection #3777

Closed
wants to merge 1 commit into from
Closed

Conversation

swznd
Copy link

@swznd swznd commented May 5, 2018

isArrayLike return true when Object has length properties

_.isArrayLike({ name: 'video.mp4', length: 26210 });
=> true

`isArrayLike` return `true` when Object has length properties

```
_.isArrayLike({ name: 'video.mp4', length: 26210 });
=> true
```
@jsf-clabot
Copy link

jsf-clabot commented May 5, 2018

CLA assistant check
All committers have signed the CLA.

@jdalton jdalton added the invalid label May 5, 2018
@jdalton jdalton closed this May 5, 2018
@swznd
Copy link
Author

swznd commented May 5, 2018

Hi @jdalton

could you tell me why you marked as invalid? Because this bug produce error in _.forEach

_.forEach({ 'a': 1, 'b': 2, 'length': 12 }, function(value, key) { console.log(key, value) });

=> 0 undefined
1 undefined
2 undefined
3 undefined
4 undefined
5 undefined
6 undefined
7 undefined
8 undefined
9 undefined
10 undefined
11 undefined

@jdalton
Copy link
Member

jdalton commented May 6, 2018

Hi @swznd!

The behavior of isArrayLike is intentional.

@lock
Copy link

lock bot commented May 6, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants