5 ms·
I want to learn more German and more javascript. I took german in high school 20+ years ago but sucked at it and struggled through it for my language requireme
by jccalhoun 10y ago
I want to learn more German and more javascript.
I took german in high school 20+ years ago but sucked at it and struggled through it for my language requirement in my phd. A decent amount of literature in my field is in German so I want to get better at translating it. I'm doing duolingo.
I went through the javascript program at codeavengers last summer and now I'm looking to build on that.
- schoen 10y ago> I want to learn more German [...] I'm doing duolingo. Haben Sie schon daran gedacht einen Kurs zu machen? Gibt es z.B. ein Goethe-Institut wo Sie wohnen? Die Kurse, die sie anbieten, sind etwas teuer, aber nützlich.
- jccalhoun 10y agothanks. I understood about half of that! :-) I don't really want to be better at speaking it just reading it (of course I know one would help the other)
- schoen 10y agoThe Goethe Institut definitely believes in "whole language" and they consciously practice reading, writing, speaking, listening, and grammar and vocabulary study during every single class. If you don't want that, it's indeed probably not your best best. (Also, there's kind of this subtext about language skills for living in Germany, because a lot of the class activities are about roleplaying stuff like trying to rent an apartment, visit a doctor, order food in a restaurant, or go clothing shopping in Germany.)
- mevile 10y agoHere's a couple of new things about JS you can learn right now! Currying! Arrow functions! Template strings! function getPrefixer(prefix) { return str => `${prefix}: ${str}`; } Now use it! const infoLogger = getPrefixer('info'); infoLogger('Starting up!'); // returns 'info: Starting up!' infoLogger('Not being used!'); // 'info: Not being used!' Oh no, We're throwing the string away, let's use it and have it add a date and use a default argument value! function getLogger(log, prefix='info') { return str => log(`${prefix} - ${new Date()}: ${str}`); } Now use it! const infoLogger = getLogger(msg => console.log(msg)); infoLogger('Starting up!'); //Logs 'info - Sat May 28 2016 08:51:12 GMT-0700 (PDT): Starting up!' to console! const errorLogger = getLogger(msg => { throw msg }, 'error'); errorLogger('Oh no!'); // throws an error with 'error' prefix! See it in action here with babel: https://jsfiddle.net/xgwe121v/ https://jsfiddle.net/xgwe121v/
- brown-dragon 10y agoThis is a very cool intro to the new features of JS! Thanks! :-) What part here is Currying?
- mevile 10y agoThe currying part is the variable that you give to the first function. In the first function the prefix variable is stored in the local scope of the big arrow function that is returned. This ability of functions to remember variables from the scope in which they were created is called closures, and storing a variable like this is a closure. Using closures to generate functions with preset variables is currying.