Editing Code Wreaked Havoc on Site

Hello -

I was attempting to make a small change in the edit code section of my theme (Symmetry 6.0.3). I was trying to move the search bar from the left side to the right side of the header. I found a code snippet in Shopify community. I followed the instructions, copying it into the theme.js asset at the very bottom. It didn’t work, so I deleted it. When I did, my entire theme went blank and I can’t figure out how to fix it. I think I must have accidentally removed some integral part of the original code. Can anyone tell me what is missing here?

//Register dynamically pulled in sections
$(function ($) {
if (cc.sections.length) {
cc.sections.forEach((section) => {
try {
var data = {};
if (typeof section.deferredLoad !== ‘undefined’) {
data.deferredLoad = section.deferredLoad;
}
if (typeof section.deferredLoadViewportExcess !== ‘undefined’) {
data.deferredLoadViewportExcess = section.deferredLoadViewportExcess;
}
theme.Sections.register(section.name, section.section, data);
} catch (err) {
console.error("Unable to register section ".concat(section.name, “.”), err);
}
});
} else {
console.warn(‘Barry: No common sections have been registered.’);

})(theme.jQuery);
/* Built with Barry v1.0.8 */

Either restore a backup/duplicate of the theme, or transplant a themes theme.js into the broken theme from a backup or download a new copy of the theme from the theme store(as long as its near the same version i.e. v6.0.3 using a v9.0 would probably be bad)

If you need this debugged/fixed then can contact me by mail for theme services.
Please always provide context, examples: store url, theme name, post url(s) , or any further detail.
Contact Info in signature.