Is there a way to run JavaScript in R? : I am working on a project which is primarily in R and requires some JavaScripts to run. So, I need a way to run JavaScripts in R itself. 

for example, Is there any way run below JavaScripts in R?

    public static void main(String[] args){
    
      for(int i=0;i<5;i++){
    
    	 System.out.println("HelloWorld");
    
     }
    
    } 

** Lib in R (v8,rJava,rserve)