Okay. I’ve put together a few code examples for you that should help you figure these out. The comments should help explain what is going on, but otherwise just track which alert is which as the code runs as they just display various results one after the other.
//Display the hyperlink for the current draft
alert(draft.permalink);
//Create a single unchecked line
let strTemp = "[ ] foo";
alert(strTemp);
//Replace the uncheck with an "O" based check
alert(strTemp.replace("[ ]", "[O]"));
//Add another unchecked line
strTemp += "\n[ ] bar";
alert(strTemp);
//Try the same replace as before
//It only replaces the first instance so this replace is only going to work if we go line by line
alert(strTemp.replace("[ ]", "[O]"));
//If we use a regular expression, we can change all occurrences
alert(strTemp.replace(/\[ \]/g, "[O]"));
//Add another unchecked line with a mid-line uncheck
strTemp += "\n[ ] quz & another [ ] on the same line";
alert(strTemp);
//If we want to replace all, it will get the mid line too
alert(strTemp.replace(/\[ \]/g, "[O]"));
//If we only want the start of the line we change the regular expression
alert(strTemp.replace(/^\[ \]/mg, "[O]"));
Keep in mind that removing text is logically the same as replacing it with a text string of zero length.