{
    "path": "/home/krm/dev/mimer-academia/programing/js/event/Questions/callback.sv.json",
    "s": "Ignor",
    "invert": true,
    "level": 1,
    "title": [
        "Callback"
    ],
    "author": [
        "krm"
    ],
    "created": {
        "year": 2023,
        "month": 10,
        "day": 9
    },
    "status": "alpha",
    "description": [
        "Ange värdet på utrycket nedan. Blir det ett fel så skriv vilken typ av error det blir. Finns det fler utryck på samma rad är det värdet av det \nsista utrycket som ska anges. Förutom koden som ska vara gemensam så \nutgår vi från att inget utryck påverkar en annan uppgift."
    ],
    "statments": [],
    "comment": [],
    "cards": [
        {
            "level": 1,
            "index": 1,
            "exactly": true,
            "title": [
                "let a = (x)=>2*x; function foo(f) {return f(3)}; foo(a)"
            ],
            "description": [],
            "statments": [
                {
                    "description": [
                        "undefined"
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "title": [
                "🪧 Vi leker med funktioner som parametrar"
            ],
            "description": [],
            "lang": "js",
            "code": "let f1 = (x)=>3*x+1;\nlet f2 = (x)=>5*x;\nlet f3 = (x)=>7*x+3;\nfunction foo(f,n) {\nlet summa = 0;\nfor(let i = 0; i < n; i++) { \nsumma += f(i);\n}\nreturn summa;\n}",
            "statments": [],
            "comment": [],
            "cards": [
                {
                    "level": 2,
                    "index": 2,
                    "exactly": true,
                    "title": [
                        "foo(f1,0)"
                    ],
                    "description": [],
                    "statments": [
                        {
                            "description": [
                                "undefined"
                            ]
                        }
                    ],
                    "comment": []
                },
                {
                    "level": 2,
                    "index": 3,
                    "exactly": true,
                    "title": [
                        "foo(f1,1)"
                    ],
                    "description": [],
                    "statments": [
                        {
                            "description": [
                                "undefined"
                            ]
                        }
                    ],
                    "comment": []
                },
                {
                    "level": 2,
                    "index": 4,
                    "exactly": true,
                    "title": [
                        "foo(f1,2)"
                    ],
                    "description": [],
                    "statments": [
                        {
                            "description": [
                                "undefined"
                            ]
                        }
                    ],
                    "comment": []
                },
                {
                    "level": 2,
                    "index": 5,
                    "exactly": true,
                    "title": [
                        "foo(f2,3)"
                    ],
                    "description": [],
                    "statments": [
                        {
                            "description": [
                                "undefined"
                            ]
                        }
                    ],
                    "comment": []
                },
                {
                    "level": 2,
                    "index": 6,
                    "exactly": true,
                    "title": [
                        "foo(f3,f1(1))"
                    ],
                    "description": [],
                    "statments": [
                        {
                            "description": [
                                "undefined"
                            ]
                        }
                    ],
                    "comment": []
                }
            ],
            "kind": "question"
        },
        {
            "level": 1,
            "title": [
                "🪧 Vi leker med callback"
            ],
            "description": [],
            "lang": "js",
            "code": "function callback() {\nconsole.log(\"hej\");\n}\nsetTimeout(callback, 1000);",
            "statments": [],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 7,
            "exactly": true,
            "title": [
                "Hur lång tid kommer det gå innan koden ovan göra någonting?"
            ],
            "description": [],
            "statments": [
                {
                    "description": [
                        "undefined"
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 8,
            "exactly": true,
            "title": [
                "Vad gör koden för någonting?"
            ],
            "description": [],
            "statments": [
                {
                    "description": [
                        "undefined"
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "title": [
                "🪧 Vi leker mera med callback"
            ],
            "description": [],
            "lang": "js",
            "code": "let count = 10;\nfunction callback() {\nconsole.log(count);\ncount--;\nif(count > -1) {\nsetTimeout(callback, 1000);\n}\n}\ncallback();",
            "statments": [],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 9,
            "exactly": true,
            "title": [
                "Hur lång tid kommer det på ett ungefär gå innan koden är klar?"
            ],
            "description": [],
            "statments": [
                {
                    "description": [
                        "undefined"
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 10,
            "exactly": true,
            "title": [
                "Vad kommer koden ovan skriva ut?"
            ],
            "description": [],
            "statments": [],
            "comment": [],
            "kind": "question"
        }
    ],
    "kind": "questions"
}