5/11/2017 12:41:55 PM김정제(Legacy)
12 AnswersNew Answer
You can use babel.min.js for using es6 in older JS engines. https://code.sololearn.com/W0FsE4Jg5EG5/?ref=app
@Ashwani Kumar Oh It works in my mobile. Maybe my tablet is troublesome. bad device :( Anyway thank you for your help!
@visph thank you for your reply :) I always code with my tablet(kind of android but a bit big). So Is it hard for me to use those things with my tablet?
@Ashwani Kumar Thanks for your comment unfortunately console says "Uncaught SyntaxError: Unexpected Identifier(Line 35)
@visph Those features makes code clearer and shorter. That's what I'm looking for. Anyway, I'm gonna install FF.
@Thanh Le Thanks! I'll search about Babel.
Yeah works well for me too. And just tested on my android device - 7.1.1 It works even without including Babel.
You can probably ( even surely ^^ ) use these 'advanced' JS feature by using website version of code playground, opened in Firefox web browser... Maybe others desktop browsers will support that also: you have to try ( or look in the MDN ressources the compatibility tables ) ^^ On mobile browsers, I don't have really idea, but on app', the android webview is used, and could not support that... actually ;) in addition to eventual sololearn limitations ( as the console bypass, or some JS object not authorized -- I don't remember which :P )
You can try to install mobile version of Firefox, and use it to access code playground ( but better is to verify before on MDN if those features are supported also in the mobile version -- some advanced features are even only available in Firefox developers edition / nightly build ^^ ). Anyway, these advanced features are really cool, but while they aren't widely supported, they're not really useful, except in special case where user browsers are known :P
@Ashwani Kumar code works well for me ^^ Probably a question of android and/or webview version :(
@Ashwani Kumar: You're right... I haven't tested without :P Code works well for me also without Babel ^^ ( android 6.0 - webview 57.0.2987.132 )
Unfortunately you can't. :( I think the JS engine is a little bit out-dated on sololearn. But you can use a transpiler like Babel that converts your ES6 syntax into ES5 syntax. Then it will also work on sololearn's playground. Good luck!