As a beginner, i would recommend you get to know the nodes a bit better before reaching for a function node.
Here is another approach:
Demo flow
Use CTRL+I
to import
[{"id":"c1d40a844369be8f","type":"inject","z":"e0236af69e824001","name":"Fake Sensor 1 true","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":330,"y":160,"wires":[["a45425b2a93f587f"]]},{"id":"3af7aefde8bc24b7","type":"inject","z":"e0236af69e824001","name":"Fake Sensor 1 false","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":330,"y":200,"wires":[["a45425b2a93f587f"]]},{"id":"94cd9a8bf54d4059","type":"inject","z":"e0236af69e824001","name":"Fake Sensor 2 true","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":330,"y":300,"wires":[["a45425b2a93f587f"]]},{"id":"026ebcf939ce4106","type":"inject","z":"e0236af69e824001","name":"Fake Sensor 2 false","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":330,"y":340,"wires":[["a45425b2a93f587f"]]},{"id":"a45425b2a93f587f","type":"switch","z":"e0236af69e824001","name":"is true?","property":"payload","propertyType":"msg","rules":[{"t":"true"}],"checkall":"true","repair":false,"outputs":1,"x":560,"y":240,"wires":[["1373dc1ab9abfef5"]]},{"id":"3efc628fc449d21c","type":"debug","z":"e0236af69e824001","name":"to next node ->","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":740,"y":360,"wires":[]},{"id":"1373dc1ab9abfef5","type":"trigger","z":"e0236af69e824001","name":"send false after 10s (extend if more arrive)","op1":"","op2":"false","op1type":"pay","op2type":"bool","duration":"10","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":660,"y":300,"wires":[["3efc628fc449d21c"]]}]