- {
- "nodes": [
- {
- "id": "node1",
- "type": "input",
- "label": "Number 1",
- "x": 100,
- "y": 100
- },
- {
- "id": "node2",
- "type": "input",
- "label": "Number 2",
- "x": 100,
- "y": 200
- },
- {
- "id": "node3",
- "type": "function",
- "label": "Multiply",
- "code": "const result = num1 * num2;\nreturn result;",
- "x": 300,
- "y": 150
- },
- {
- "id": "node4",
- "type": "function",
- "label": "Swap",
- "code": "const temp = num1;\nnum1 = num2;\nnum2 = temp;\nreturn [num1, num2];",
- "x": 500,
- "y": 150
- },
- {
- "id": "node5",
- "type": "output",
- "label": "Debug",
- "x": 700,
- "y": 150
- }
- ],
- "connections": [
- {
- "source": "node1",
- "target": "node3",
- "sourcePort": "value",
- "targetPort": "num1"
- },
- {
- "source": "node2",
- "target": "node3",
- "sourcePort": "value",
- "targetPort": "num2"
- },
- {
- "source": "node3",
- "target": "node5",
- "sourcePort": "result",
- "targetPort": "value"
- },
- {
- "source": "node1",
- "target": "node4",
- "sourcePort": "value",
- "targetPort": "num1"
- },
- {
- "source": "node2",
- "target": "node4",
- "sourcePort": "value",
- "targetPort": "num2"
- },
- {
- "source": "node4",
- "target": "node5",
- "sourcePort": "result",
- "targetPort": "value"
- }
- ]
- }
[text] GITHUB ANS- swap num
Viewer
Editor
You can edit this paste and save as new: