2,875
edits
(Created page with "local p = {} local Debug = require('Module:Debug') local TableIterator = require('Module:FunList/Sandbox') local mainTable = { [1] = { id = 1, name = "Item One", details = { description = "This is the first item.", price = 10.99 } }, [2] = { id = 2, name = "Item Two", details = { description = "This is the second item.", price = 20.49 } },...") |
No edit summary |
||
Line 42: | Line 42: | ||
local enum = TableIterator.new(tbl) | local enum = TableIterator.new(tbl) | ||
local result = | local result = TableIterator.new(mainTable) | ||
: | :where(function(x) return x.id % 2 ~= 0 end) | ||
:flatMap(function(x) return x.details end) | |||
:flatMap(function(x) return x end) | :where(function(x) return tonumber(x) ~= nil end) | ||
: | :sum() | ||
Debug.log(result) | Debug.log(result) |
edits