I have a function called getEntries.
function getEntries(config = defaultConfig, contentTypeFilter = defaultContentTypes) {
// defaultContentTypes is an Array
}
I'd like getEntries to be called without passing an array literal.
getEntries(config, 'blogPosts', 'pages');
Internally, I would still like to treat it as an array using the rest operator:
function getEntries(config = defaultConfig, ...contentTypeFilter = defaultContentTypes)
But I'm getting an error pointing to the = sign presumably because of the way I'm trying to combine them or because they can't be combined:
Module build failed: SyntaxError: Unexpected token, expected )
I'm aware that I can set a default internally using the OR operator. But I'm curious if combining these two is possible.