JavaScript - the future of programming.

It’s been awhile, after I done with my SQLi project I start to learn XSS, I found it fascinating! but I felt like I need more strong base knowledge about JavaScript to do my magic stuff. after a week or two I decided to make my on tutorials video about JS and this time in Hebrew, from that project I was learn a lot!

Originally I wrote that tutorial for Michael which is a friend but unfortunately he give up on JS studies for some unknown reason.

So here I am finding myself work on some tutorial that is basically designed for me lol!

I have 3 goals in the next few weeks, first of all I want to do the JS exam that w3schools offers, with this exam I can examine my knowledge in JavaScript and I will feel comfortable with that.

The second goal is to pass succesfully the GWAPT exam which examine your knowledge in web application penetration testing, for XSS attack and XSRF, the best you can do for your self is to concentrate on JavaScript knowledge because it’s (web attacks - especially XSS & XSRF) have a great deal with JavaScript.

The third goal is to pass the OSCP exam which examine your knowledge in the world of penetration testing.

On my JavaScript tutorial I am teach every filed and chapter through w3schools, and in more few days I will be ready to take the exam.

The tutorial contain also some challenges that I found on the web and we solved it together, after that we will start to develop our won game! and do some more cool stuff.

I love JS, It is fun and challenge my mind how to do big stuff in short mount of time.

To help myself to preper the exam, I build some test with many question about JavaScript and hope it’s will help every one who watch this tutorial and want to take the exam too.

JavaScript - the first video about the tutorial:

So like I said that tutorial is build in such a way to help me to pass the exam, but to be sure enough that I will succeed to pass the exam I made some self test to check my (or your) knowledge.

On this quiz you will find question that I found on the web and more question that I made, if you have some issue with some question please feel free to contact me.

JavaScript - quiz:

1. Inside which HTML element do we put the JavaScript?


2. What is the correct JavaScript syntax to change the content of the HTML element below?
<p id="demo">This is a demonstration.</p>

document.getElement("p").innerHTML = "Hello World!";
#demo.innerHTML = "Hello World!";
document.getElementByName("p").innerHTML = "Hello World!";
document.getElementById("demo").innerHTML = "Hello World!";

3. What is boolean?

It is some positive value
It is some value base on True or False
t's a binary value that can be 0 or 1
none of the answers are correct

4. Where is the correct place to insert a JavaScript?

The <head> section
The <body> section
Both the <head> section and the <body> section are correct

5. What is the correct syntax for referring to an external script called "xxx.js"?

<script name="xxx.js">
<script src="xxx.js">
<script href="xxx.js">
<script link="xxx.js">

6. The external JavaScript file must contain the <script> tag.

The tage can be what you whant
The tag must be with src element

7. How do you write "Hello World" in an alert box?

msgBox("Hello World");
alert("Hello World");
msg("Hello World");
alertBox("Hello World");

8. How do you call a function named "myFunction"?

call function myFunction()
call myFunction()

10.How to write an IF statement in JavaScript?

if i = 5 then
if i == 5 then
if (i == 5)
if i = 5

10. How to write an IF statement for executing some code if "i" is NOT equal to 5?

if i =! 5 then
if i <> 5
if (i!=5)

11. How does a WHILE loop start?

while (i <= 10)
while (i <= 10) than
while i = 1 to 10
while (i <= 10; i++)

12. How does a FOR loop start?

for (i = 0; i <= 5; i++)
for (i = 0; i <= 5)
for (i <= 5; i++)
for i = 1 to 5

13. How can you add a comment in a JavaScript?

<!--This is a comment-->
//This is a comment
'This is a comment
#This is a comment

14. How to insert a comment that has more than one line?

<!--this comment has <br> more then one line-->
//This comment has <br> more then one line//
//This comment has <br> more than one line*/
/*This comment has <br> more than one line*/

15. What is the correct way to write a JavaScript array?

var colors = "red", "green", "blue"
var colors = (1:"red", 2:"green", 3:"blue")
var colors = 1 = ("red"), 2 = ("green"), 3 = ("blue")
var colors = ["red", "green", "blue"]

16. How do you round the number 7.25, to the nearest integer?


17. How do you find the number with the highest value of x and y?

ceil(x, y)
top(x, y)
Math.max(x, y)
Math.ceil(x, y)

18. What is the correct JavaScript syntax for opening a new window called "w2" ?

w2 ="");
w2 ="");
w2 = window.winNew("");
w2 ="");