{
    "path": "/home/krm/dev/mimer-academia/programing/js/objects/Questions/new.sv.json",
    "s": "Ignor",
    "invert": true,
    "level": 1,
    "title": [
        "new"
    ],
    "author": [
        "krm"
    ],
    "created": {
        "year": 2023,
        "month": 10,
        "day": 12
    },
    "status": "alpha",
    "description": [
        "Ange värdet på utrycket nedan."
    ],
    "statments": [],
    "comment": [],
    "cards": [
        {
            "level": 1,
            "index": 1,
            "exactly": true,
            "title": [
                "function constructor() {this.a=1}; let o = new constructor(); o.a"
            ],
            "description": [],
            "statments": [
                {
                    "description": [
                        "1"
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 2,
            "exactly": true,
            "title": [
                "function constructor(x) {this.a=1; this.b=x}; let o = new constructor(20); o.b"
            ],
            "description": [],
            "statments": [
                {
                    "description": [
                        "20"
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 3,
            "exactly": true,
            "title": [
                "function constructor(x, y) {this.a=2; this.b=x; this.c=x*y}; let o = new constructor(20,10); o.a+o.b+o.c"
            ],
            "description": [],
            "statments": [
                {
                    "description": [
                        "222"
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 4,
            "exactly": true,
            "title": [
                "function constructor() {this.a=1; return {a:2}}; let o = new constructor(); o.a"
            ],
            "description": [],
            "statments": [
                {
                    "description": [
                        "2"
                    ]
                }
            ],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "title": [
                "🪧 Vi leker med en konstruktor"
            ],
            "description": [
                "I uppgifterna nedan utgå från att de utförs efter varandra."
            ],
            "lang": "js",
            "code": "function student(name) {\nthis.name=name;\nthis.point = 0;\nthis.label = function() {\nreturn this.name + \": \" + this.point + \"p\"\n}\nthis.add = function(x) {\nthis.point = this.point + x;\n}\n}; \nlet kalle = new student(\"Kalle\");\nlet kajsa = new student(\"Kajsa\");",
            "statments": [],
            "comment": [],
            "cards": [
                {
                    "level": 2,
                    "index": 5,
                    "exactly": true,
                    "title": [
                        "kalle.name"
                    ],
                    "description": [],
                    "statments": [
                        {
                            "description": [
                                "Kalle"
                            ]
                        }
                    ],
                    "comment": []
                },
                {
                    "level": 2,
                    "index": 6,
                    "exactly": true,
                    "title": [
                        "kajsa.label()"
                    ],
                    "description": [],
                    "statments": [
                        {
                            "description": [
                                "Kajsa: 0p"
                            ]
                        }
                    ],
                    "comment": []
                },
                {
                    "level": 2,
                    "index": 7,
                    "exactly": true,
                    "title": [
                        "kalle.add(10); kalle.label();"
                    ],
                    "description": [],
                    "statments": [
                        {
                            "description": [
                                "Kalle: 10p"
                            ]
                        }
                    ],
                    "comment": []
                },
                {
                    "level": 2,
                    "index": 8,
                    "exactly": true,
                    "title": [
                        "kajsa.point=10;kajsa.add(10); kajsa.point;"
                    ],
                    "description": [],
                    "statments": [
                        {
                            "description": [
                                "20"
                            ]
                        }
                    ],
                    "comment": []
                }
            ],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 9,
            "reflection": true,
            "title": [
                "Beskriv med egan ord vad kommandor \"new\" gör för att skappa ett objekt."
            ],
            "description": [],
            "statments": [],
            "comment": [],
            "kind": "question"
        },
        {
            "level": 1,
            "index": 10,
            "reflection": true,
            "title": [
                "Vad används objektet *this* till?"
            ],
            "description": [],
            "statments": [],
            "comment": [],
            "kind": "question"
        }
    ],
    "kind": "questions"
}