// Import import foo from 'bar_modules'; import bar from 'foo_modules'; // Export + sub keywords like async & await export const loadRecipe = async function (id) { // Try try { const data = await AJAX(`${API_URL}${id}?key=${KEY}`); state.recipe = createRecipeObject(data); // If else if (state.bookmarks.some(bookmark => bookmark.id === id)) { state.recipe.bookmarked = true; } else { // Object name with just properties state.recipe.bookmarked = false; } // Object name with method console.log(state.recipe); } // Catch catch (err) { // Temp error handling console.error(`Error: ${err}`); throw err; } }; // Variable declaration let testObj = { name : 'Foo', age : 24, isRoot : true, // True nestingA1 : { name : 'Bar', age : 65, isRoot : false, // False }, nestingA2 : { isRoot : true, // True nestingB1 : [{ name : 'Bar', age : 65, // Object keys (when declaring) are italic, unlike properties (when using) isRoot : false, }], }, nestingA3 : [ { name : 'Bar'}, // Easily distingushable object + arrays due to separate bracket groups & color { list : [{a : 1, b : 2}, {c : 3, d : 4}, {d: 4, e : 5}]}, { isRoot : [ 'foo', 'bar', 3, 18, ]} ] } let testFunc = function (param) { // Loop while ( (0 + 2) < 3 ) { let str = new String('Test') } } testFunc()