Praleisti ir pereiti prie pagrindinio turinio

ES6: arrow function

ES6 atsirado trumpesnė (ir su kitokiu kontekstu) funkcijos išraišką:

//'senas' variantas
function sveikinimas(message){
return alert(`${message} visiems!`);
}

sveikinimas('Labas rytas');





ES6 'arrow function' variantas:

let sveikinimas = (message) => alert(`${message} visiems!`);
sveikinimas('Labas rytas');








Komentarai

Populiarūs šio tinklaraščio įrašai

React: Material Design for Bootstrap 4

https://mdbootstrap.com 1.  create-react-app yourappnamehere 2.  cd yourappnamehere 3. Add  mdbreact  as a dependency to the package.json (the  #react-upgrade  one) 4.  yarn  /  npm  shall install all the dependencies. Note, that  mdbreact  itself includes Bootstrap ( 4.0.0-beta.2 ) as its dependency. Once all of it is out of the way, 5. time to modify your  App.js  file. To utilize full power of  MBD React  there, you need to import components you would like to use, for example import {Button, NavbarBrand, Navbar, NavbarNav, NavItem} from 'mdbreact'; and secondly, you need proper CSS files. As MDB partially builds upon Bootstrap, it's safest to include both: import '../node_modules/bootstrap/dist/css/bootstrap.min.css'; import '../node_modules/mdbreact/docs/css/mdb.min.css'; As you can see, there is no jQuery involved. The warning popping out during  npm install  /  yarn stems ...

String sudėjimas

String 'sudėjimas' - sujungimas dviejų (arba bent vieno ir kito number) string duomenų. Pvz: "Labas"+"Lietuva" "Labas" + " Lietuva" "Dabar" + 20+17 "Dabar" + " 20"+"17"