modifyCurrentlySelectedComponent(property, value) {
        const selectedComponent = globalScope.getCurrentlySelectedComponent();

        if (selectedComponent.objectType === 'Node') {
            const nodeId = selectedComponent.id;
            const nodeIndex = this.findNodeIndexById(nodeId);
            globalScope.allNodes[nodeIndex][property] = value;
            return;
        }
        for (const key in globalScope) {
            const component = globalScope[key];
            if (Array.isArray(component) && component.length) {
                component.forEach((obj, index) => {
                    if (obj === selectedComponent) {
                        component[index][property] = value;
                    }
                });
            }
        }
    }
Function to modify the currently selected component's object in the globalScope
takes the property which needs to modify
and the modified value as parameters