Javascript hoisting

Javascript
I am learning javascript hoisting feature, and find the following codes are really confusing: var a = 1; function b() { a = 10; return; f...
1 year ago

Javascript game

Javascript
I just made this tiny game, where a user can click. And he can see his clicks, just like 'cookieclicker'. Everything works, except for one thing. I ...
1 year ago

javascript domready?

Javascript
I know I can use different frameworks like prototype or jquery to attach a function to the window.onload, but's not what I'm looking for. I need some...
2 years ago

Javascript prototype

Javascript
Using a constructor function and a prototype, I want the Grade function to output a number grade into a letter grade. function Grade(name, grade) ...
2 years ago

Javascript Recursion?

Javascript
I am practicing recursion. Conceptually I understand how this should work, (see below) but my code isn't working. Please tell me what I am doing wro...
2 years ago

JavaScript session?

Javascript
How do you make a JavaScript session? if (gameWin) { Session["BrugerTid"] = document.all("counter").innerHTML; window.location = "Won.aspx"; ...
2 years ago

JavaScript Permutations

Javascript
I am trying to count the number of permutations that do not contain consecutive letters. My code passes tests like 'aabb' (answer:8) and 'aab' (answer...
1 year ago

JavaScript addEventListener

Javascript
He Stackoverflow, Question is simple, If the window size is smaller than width 960px i can click a menu button. When i click it the nav height will b...
1 year ago

Javascript collection

Javascript
sorry for noobie question. Can you explain please, what is the difference between: 1. var a = []; a['b'] = 1; 2. var a = {}; a['b'] = 1; I c...
1 year ago

Javascript Regex

Javascript
Whats the difference between using [] and () in this situation? var str = "Hel?lo the?re , Woul?d you like some ice?cream?"; var rExp = /[?+]/ig...
1 year ago

Error javascript

jQuery
In console, I have this error. I use the latest jquery 3.1. How to rectify this element ? Thank you typeError: window.on is not a function <scr...
1 year ago

Learning javascript

Javascript
Currently, I am using Javascript - The Definitive Guide for learning Javascript from scratch. Having learnt Java, PERL and other programming languages...
1 year ago

JavaScript filterRGB

Java
I'm currently in the process of converting Java to JavaScript and need to change the colour of some images. Right now each image is loaded within an ...
1 year ago

javascript pass

Javascript
Is there something along the lines of python 'pass' in javascript? I want to do the javascript equivalent of: try: # Something that throws excepti...
1 year ago

Javascript - setInterval()

Javascript
I am making a game using Javascript, and to update the game I am using setInterval(). Should I use clearInterval() somehow on the window exit, or does...
1 year ago

Javascript recursive

Javascript
i have this problem i want to create a recursive function for calculate all possibilities to have a number (k>0), with the addition of number 1 or 2. ...
2 years ago

Chat Javascript

CSS
I've made a chat in javascript and now I want to move the send messages on the left side and the received messages on the right, like Facebook or What...
2 years ago

JavaScript - assert?

Javascript
What does assert mean in javascript? I've seen something like: assert(function1() && function2() && function3(), "some text"); And...
2 years ago

Javascript Reflection

Javascript
Is there a way to get all methods (private, privileged, or public) of a javascript object from within? Here's the sample object: var Test = function(...
2 years ago

Javascript Averages

Javascript
I am trying to learn Javascript. I've built the following code to find the average from an array of numbers. It works except the last returned value...
1 year ago