Jade Cannot read the 'length' property from undefined

Why menuItemsis there undefined in the following code?

- var menuItems = ["Main","Contacts","About"]
mixin showItems(items)
    ul
        each item in items
            li: a(href="#") #{item}
extend layout
block content
    +showItems(menuItems)

I get the following error:

Unable to read property length undefined

+4
source share
1 answer
- var menuItems = ["Main","Contacts","About"]
mixin showItems(items)
    ul
        each item in items
            li: a(href="#") #{item}
extends layout
block content
    +showItems(menuItems)

There is a typo 'extends layout'

0
source

Source: https://habr.com/ru/post/1620056/


All Articles