Hello I'm looking for anybody can solve this question .. please reply

One of our agents recently caught a young hacker with the code name !$criptkiddie. He hid the below piece of javascript on a page which calculates a value but doesn’t output the final result. It’s also embedded on this page - can you find the result?

var string = “2b903102b29299c12d6c1e2ac80169”;

var flag = “”;

for (var i = 0; i < string.length; i++) {

// There is an easier way to find this than calculating by hand!

var ascii = string.charCodeAt(i);

ascii = ascii + i;

flag = flag + String.fromCharCode(ascii);

}

flag = "The flag is: " + flag;

Um what is your problem? Syntax? if its not syntax then printscreen your window in computer.

sorry but I’m beginner in the javascribt

is this a Codecademy Pro Exclusive?

no we have a competition in UAE and if I wanna enter I have to answer three missions but I answered just a one so I need a help please

Ok ima try to anwser it and see whats wrong with your code. Nvm i need a verification code

1 Like

thanks … I’ll go now but I’ll open the website again tomorrow I wish that you will find the result

When they say ‘value’ it is a number, or a sum?

var number = parseInt("2b903102b29299c12d6c1e2ac80169",16);
console.log(number);     //  2.2619331491473775e+35

As a sum,

var string = "2b903102b29299c12d6c1e2ac80169";
var sum = 0;
for (var i = 0; i < string.length; i++) {
    sum += parseInt(string[i], 16);
}
console.log(sum);     //  179

so the answer is 2.2619331491473775e+35 or 179
but when I put the answer in the website it just “nope that’s wrong”

Is this a trick question? Because this line doesn’t make any sense, overwriting as it does the variable above it. What happens when you comment that line?

The flag is: 2b903102b29299c12d6c1e2ac80169