ekocibar / javascript1 Goto Github PK
View Code? Open in Web Editor NEWFront End
Front End
https://github.com/pesh12/ENES-JS/blob/master/Week%200%20~%20canI.js
if(differentTypes[4] = true)
will always be true!!!
Only == checks, = just assigns one to the other.
Did you come up with both methods of comparing arrays yourself?
console.log(3 === 3 ? "true" : "false");
lik ethis
Look up the difference and try using just an array.
Now you're looping through the entire second objects list of keys for every key in obj1.
This is a lot more readable
let differentTypes = [ 1, 'Hello', 2, 'World', true];
if(differentTypes[4] = true)
{
console.log( 'Yes, we can store different types in a single array' + differentTypes[1] + differentTypes[3])
}
One file per week is fine for now ;)
If you pass a number (index) to the function for your list, you can get the right list item like so list[number]. This will only work for arrays btw.
https://github.com/pesh12/ENES-JS/blob/master/Week1/0%20allTogether.js#L20
Why are you passing an assignment of "a=" to the function? That' a bit confusing and unnecessary.
A ul should ONLY have lis inside it. not loose text.
Please describe below how you got this idea.
So the function already works really well. I like how you add headings to each book.
First thing that could be better is adding the lis to a list. Theyre list elements after all so adding them to the body doesnt make sense, give them an ul parent.
Second: What could be better is the variable names. instead of item1 for instance, write liElement.
Third: Try giving the newlist a parameter, and have that parameter be the list of books. That way you could also pass it another list of books and it would still work!
By putting let list = inside the function, it will run everytime you call the function. You should define the list outside the function so it's only created once.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.