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

Filter problem #45

Open
springimport opened this issue Dec 6, 2016 · 0 comments
Open

Filter problem #45

springimport opened this issue Dec 6, 2016 · 0 comments

Comments

@springimport
Copy link

I have an error with a filter function.

Uncaught TypeError: Cannot read property 'filter' of undefined
    at HTMLInputElement.change ((index):412)
    at HTMLInputElement.u [as __onchange] (d3.v3.min.js:1)
function change() {
    // Filter out any zero values to see if there is anything left
    var remove_zero_values = dataset[this.value].filter(function(value) {
        return value > 0;
    });
...

My solution:

if (dataset[this.value] !== undefined) {
    var remove_zero_values = dataset[this.value].filter(function(value) {
        return value > 0;
    });
} else {
    var remove_zero_values = [];
}
steffenmaechtel added a commit to steffenmaechtel/opcache-status that referenced this issue Nov 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant