Jump to content

webmanz

Member
  • Posts

    71
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by webmanz

  1. Before posting I looked at w3schools found 4 same loops, I just thought there might be more, so for now I will conclude that's all the loops there is in JS.
  2. Are there only 4 types of loops in js? Are there more? while, do/while, for, for/in
  3. Do "if else" conditional statements only ever appear together? Can you have an 'else' without an 'if and vice versa?
  4. Yes makes better sense now. I mistakenly thought Javascript was a functional programming language, thanks for clarifying.
  5. Can we label DOM as a JIT complier?
  6. This is an example of anonymous function with no name? function() The above appears to ask for a name in console log and appears as an error.
  7. Chapter 5 lesson 5 5.37 minute mark of video alert("Alert: " + "stef@studioweb.com" . indexOf("@") For the above to work do I still need to type in code mentioning console log? In other words just that one line of code without any mention of console log or anything else? By anything else I mean: var email var theAt console.log In the video the js position shows up in console log using that one line of code.
  8. Yes got resolved in subsequent videos. Thanks
  9. Chapter 5 part 2 1.57 minute mark You said""When I click the button I am going to call sniffer..." The code looks like this in the video: document.getElementById("butt").onclick=function(){ sniffer("Clicked on secondP"); outSide(); If sniffer was called then in the video we would have seen an alert saying "Clicked on secondP". I also note that they was no actual second paragraph to click.
  10. Should we use camel case when naming js external files? example: spaceinvaders.js versus spaceInvaders.js Which one is best practice?
  11. webmanz

    sniffer

    1. We can't say they are keywords though, on par with function and var? 2. Can we say function and var are built in methods of JS too? 3. Are built in methods the same thing as a 'keyword'?
  12. webmanz

    sniffer

    example from chapter 2: function sniffer(message) Q: Is sniffer a made up word or does it have some special standing in JS with things like 'alert' and 'prompt'? Q: Are alert and prompt js keywords too?
  13. By your reply you mean this is not true?
  14. By this I mean a function that can return a function as its output. What is the correct term to describe such a thing?
  15. Chapter 4 part 3 Question 2: Using only one statement, create a variable with the name of 'age' and give it a value of: 18 I answered var age="18" but the correct answer was var age= 18 Why my answer was incorrect as it did have the quotes in the right spot.
  16. Ignore that. Thanks for reply
  17. re chapter 3 lesson Javascript Errors From this: console.log("Something happened: " + message); } to this console.log("Something happened: + message); } Using Sublime the only thing that changed color for me when I removed quotes as per the video was + message, it changed color and there was a horizontal pink box stretching left to right on same code line just after + message had changed color. Unlike the video lesson the rest of my code didn't change color when I removed the quotes - they remained the same colors. Perhaps it's its something to do with my settings? Stef did mention you can adjust color error code within Sublime.
  18. Can we say an event handler is always or solely used in function within function scenario's? Or within high order function scenario's?
  19. Will knowing JS which is a functional programming language make it easier to learn C++ (object programming language)? I would like to learn C++ thru video as well.
  20. Stef No definitive reason was given as to why its best practice to place getElementById at the bottom of document when used together with anonymous functions in lesson 6 chapter 2. Would anything be different if it was placed higher up in the document?
  21. 1. I was wondering why alert argument has only one apostrophe and console log has two in this example below? 2. Can we say the console log has an argument too? document.getElementById("secondP").onmouseover=function(){alert('Mouse over second P'); console.log("Log the anonymous Inner function on secondP")
  22. Can we say anonymous functions have no name and no argument as well ?
  23. Re Event Handlers part 2 from Chapter 2 The only consol error I couldn't replicate as per the video was the hover. In the video the consol log error appears as: Something happened: 2nd p tag moused-over Instead I get on Sublime text Firefox: SyntaxError: identifier starts immediately after numeric literal My code looks like this: <!DOCTYPE html> <html onkeypress="sniffer('You pressed a key!')"> <head> <meta charset="UTF-8"> <title> Ch2 Javscript</title> <script> function sniffer(message) { console.log("Something happened: "+ message); } </script> <style type="text/css"> #secondP {width: 200px; background-color: #AFE6A5} p:hover, button:hover {cursor: pointer;} </style> </head> <body onresize="sniffer('window resized')" onload="alert('page loading')"> <h1>Welcome Uber Nerdling!</h1> <button id="butt" type="button" onlcick="sniffer('Try it button clicked')">Try it</button> <p onclick="sniffer('p tage clicked')">&Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quaerat neque quo inventore ipsam, eveniet obcaecati et possimus, quas sed dolores autem delectus expedita! Quis amet alias accusantium at debitis, tempora.</p> <p onmouseover="sniffer(2nd p tag moused-over')" id="secondP">&Lorem ipsum dolor sit amet, consectetur adipisicing elit. Possimus quod, voluptate dolor adipisci officia consequatur blanditiis nobis voluptatibus magni ipsum. Perspiciatis, autem? Suscipit quasi nam odio blanditiis, harum voluptate quidem.</p>
  24. Re LESSON 1: Event Handlers - part 1 You have two sets of <script> on the same document, is there a reason for that or is it an error or are you allowed to do that? at 3 min mark (bottom of document) and then compare to 3.25 min (top of document) Update: problem solved. In lesson 6 there was additional code not visible in lesson 1
×
×
  • Create New...