It is not possible to push numbers to an array. If we do so:
- var min = 1
- var max = 99
- var i = min
- var array = []
while i < max
- array.push(i)
- i++
We get the following error
executing "mixin_cart" at <$n>: wrong type for value; expected pugjs.Object; got int
This is of because Array.Push only takes an object as parameter, and those initialized numbers aren't really of pugjs.Object type at that time.
However if we have something like the following
- var object = {
min: 1,
max: 99
}
- var i = object.min
- var array = []
while i < object.max
- array.push(i)
- i++
It would work perfectly, because the type of object.min assigned to i, is a valid Object.
It is not possible to push numbers to an array. If we do so:
We get the following error
This is of because
Array.Pushonly takes an object as parameter, and those initialized numbers aren't really ofpugjs.Objecttype at that time.However if we have something like the following
It would work perfectly, because the type of
object.minassigned to i, is a valid Object.