1

I have a simple multi-module javasSript app and I want to use this JavaScript code in iOS App , but it seems that WKWebView doesn't recognize 'import' keyword is JavaScriptCore code is supporting ECMAScript6 or there is another solutions

this code not run in WKWebView

import {sum} for "./Calculator"

function printResult(){
 console.log(sum(2,4)
}

1 Answer 1

1

WKWebView or JavaScriptCore not support ES6 and you have to convert it to ES5 using babel or http://browserify.org/

Sign up to request clarification or add additional context in comments.

1 Comment

Is this still up to date? Do you have a source for that info, or was it according to tests?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.