0

I am building a python application that needs to run some javascript code. I have node.js installed. I want to define a function in javascript and then be able to run it elsewhere in the program. Here is an example:

#My javascript function:
js_code = """
function add(a,b){return a+b};
"""
#Define js function here

myVar = add(3,4) #run the add function here


trigangle
  • 193
  • 1
  • 9

0 Answers0