An open API service indexing awesome lists of open source software.

https://github.com/arnav-kr/0777

The 0777 JavaScript Challenge
https://github.com/arnav-kr/0777

0777 challenge challenges hacktoberfest javascript javascript-challenge javascript-challenges js node programmer programming web

Last synced: 26 days ago
JSON representation

The 0777 JavaScript Challenge

Awesome Lists containing this project

README

        

# The 0777 JS Challenge

### Welcome to the `0777` JavaScript Challenge!

## Story

The JavaScript world is in Danger! The Evil king of the Bugs is destroying the codes written in js making them useless. You are being choosen by the JavaScript Community to go and fight the bug king so that the JavaScript developers can again live a happy and peaceful life.

You Enter the Bug Territory and secretly managed to reach the control centre of the bug king. Now you see here and there and you find that there is a large source of energy that powers the Bug King and other bug Army. If could turn off the power supply, the Bug Army and The Bug King would die. Making the JavaScript Community Bug Free.

You head on to the power source and see something there. It is a JavaScript Pass Lock. It accepts JavaScript Code as Input and if the code meets certain criteria then you will get the access.

You go a bit closer to the source and in the Pass Lock Display you see
```javascript
function key(){
var passKey;
// Write The Javascript Here and Log as Following
console.log(passKey);
console.log(typeof(passKey));
}
```
Still you are thinking how to crack the lock that you see something on the floor.

It was the manual to open The Pass Lock.

The Following was written in the manual:

**To Open The Pass Lock You have to `console log` the `0777`. There is only criteria that the type of the the returned value should be `number` nothing else.**

Once you write the correct code you would be able to deactivate the power source and save the community!

So all in your hands!
Good Luck!

## Problem

Given the code

```javascript
function key(){
var passKey;
// Write The Javascript Here and Log as Following
console.log(passKey); // Should log 0777
console.log(typeof(passKey)); // Should log "number"
}
```
You have to log the value such that when logged to the console the output should be `0777`. And the type of the logged value should be `number`.

In Points:
* console output should be `0777`
* typeof the value should be `number`
* Stuff Passed with `console.log` and with the `typeof` should either be logically same or visually same

## Test Cases

your code will be tested as follows:
```javascript
function key(){
var passKey;
// Write The Javascript Here and Log as Following
console.log(passKey);
console.log(typeof(passKey));
}
// Should Output Following:
// 0777
// "number"
```

the condition is
```js
console.log(A) // Logs 0777 to the Console
console.log(typeof(B)) // Logs number" to the Console
// Here A == B && A === B
```

> The code will be also tested by a human for correct validation.

## Constraints:

* Lines of Code Should Not be greater than 10 lines (After formatting the code with 2 Indentation).
* You cannot make changes in the primitive and native structures of javascript and also cannot interfare with prototypes.
* The code would be run in the console of the `chrome Dev Tools` on the inspected `https://google.com` site.

## Winners 🏆🎖️

@Tupiet

GitHub: [@Tupiet](https://github.com/Tupiet)

## Submission

Submit your code by the following google form:

https://forms.gle/1ZjKJXdLW34h9ZUj8

Or mail your solution on the Following Mail directly (in a `.txt` file or in plain text):

[email protected]

For any queries you can mail me on [email protected]

> **Note:** If you have already solved the Challenge then you are requested to not share your solutions with others

### The one to solve the challenge will get an interesting reward! 🏆🎖️ (yeah still applicable)