Why not use Python's [::-1], but entirely in the browser? We can load the Pyodide runtime so we can run Python in the browser through WebAssembly. We'll have to eval as no ES module is shipped, but surely that's not a problem. Also the runtime is 20MB, but it's worth it!
varstringToReverse="hello";constreversed=newPromise((resolve)=>{(async()=>{constpyodideLoaderJS=await(awaitfetch("https://cdn.jsdelivr.net/pyodide/v0.15.0/full/pyodide.js")).text()awaiteval(pyodideLoaderJS)resolve(pyodide.runPython(`
from js import stringToReverse;
stringToReverse[::-1]
`))})();});reversed.then(s=>console.log(s));
Copy it into your browser console and be amazed..
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Why not use Python's [::-1], but entirely in the browser? We can load the Pyodide runtime so we can run Python in the browser through WebAssembly. We'll have to eval as no ES module is shipped, but surely that's not a problem. Also the runtime is 20MB, but it's worth it!
Copy it into your browser console and be amazed..