webmanz Posted March 27, 2018 Report Share Posted March 27, 2018 (edited) 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? Edited March 27, 2018 by webmanz Quote Link to comment Share on other sites More sharing options...
administrator Posted March 27, 2018 Report Share Posted March 27, 2018 Hi, Sniffer is something I just made up. Alert and prompt are methods built into JS. Quote Link to comment Share on other sites More sharing options...
webmanz Posted March 27, 2018 Author Report Share Posted March 27, 2018 8 hours ago, administrator said: Alert and prompt are methods built into JS. 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'? Quote Link to comment Share on other sites More sharing options...
administrator Posted March 30, 2018 Report Share Posted March 30, 2018 Hi, Good questions. I don't believe function names are keywords ... so there would be no conflict if you had a variable named 'alert'. #1. No. They are not the same. #2. Hmm ... this is getting into the details of the JS structure. JS has both functions and methods .... in a practical sense, it is a distinction without a difference, but functions are not methods because functions can exist outside on an object. #3. No Stef Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.