console.log("Hello, World!"); void function(){function e(e){return document.getElementById(e)}function t(e){return document.getElementsByClassName(e)}var n,o=window.location.href;(function(){function i(){function i(){for(var e=t("TermText notranslate lang-en"),n=0;n<e.length;n++)e[n].innerHTML+='<br><small style="font-weight: bold; display: block;" class="answers">'+p(e[n].innerHTML)+"</small>";window.oncontextmenu=function(e){e.preventDefault();var n=t("answers");if("block"==n[0].style.display)for(var o=0;o<n.length;o++)n[o].style.display="none";else for(var o=0;o<n.length;o++)n[o].style.display="block"}}function a(){function e(e){t.grader.grade=function(e,t,n){return!0},e(),t.grader.grade=o}void 0===n%26%26(n=parseInt(prompt("Enter exact score:")));var t=window.QJP([],[],["hyek"]).a,o=t.grader.grade.bind(t.grader);t._startGame(),t.dataMap=t.dataMap.update("points",function(e){return n});for(var i=0;99>i;i++)t._advanceLevel();e(function(){console.log(null)});var s=t._promptCopyAnswer.bind(t);t._promptCopyAnswer=function(n){s(n),setTimeout(function(){e(function(){t._checkCopiedAnswer({liveTermId:n,answer:""})})},0)}}function r(){for(var n=parseInt(document.getElementsByClassName("LearnModeProgressBar-value")[0].innerHTML),o=0;n>o;o++)e("user-answer").value=Math.random(),e("js-learnModeAnswerButton").click(),t("js-learnModeOverrideIncorrect")[0].click()}function l(){return"100%25"==t("SpellModeControls-progressValue")[0].innerHTML%3F1:void(null!==e("js-spellInput")%26%26(e("js-spellInput").value=p(t("qDef lang-en TermText")[0].innerHTML),setTimeout(l,10)))}function u(){button=t("UIButton UIButton--hero")[0],button%26%26button.click(),setTimeout(function(){function e(){if(t("MatchModeQuestionScatterTile")||t("MatchModeQuestionGridBoard-tile")){for(var e=setTimeout(";"),o=0;e>o;o++)clearTimeout(o);for(var i=t("MatchModeQuestionScatterTile"),s=["%23FF0000","%23FF0000","%23FF6600","%23FF6600","%23FFFF00","%23FFFF00","%2300FF00","%2300FF00","%2300FFFF","%2300FFFF","%230033FF","%230033FF","%23FF00FF","%23FF00FF","%23CC00FF","%23CC00FF","%236E0DD0","%236E0DD0","%23C0C0C0","%23C0C0C0","%23FFFFFF","%23FFFFFF","%23A52A2A","%23A52A2A","%23F6CFFF","%23F6CFFF","%23CFD9FF","%23CFD9FF","%23FBFFA3","%23FBFFA3","%23FFD1A3","%23FFD1A3","%23710000","%23710000"],o=0;o<i.length;o++){i[o].style.backgroundColor=s[o];for(var a=0;a<i.length;a++)i[a].childNodes[0].innerHTML==p(i[a].childNodes[0].innerHTML)%26%26(i[a].style.backgroundColor=s[o])}clearTimeout(n)}}var n=setInterval(function(){e()},0)},500)}function c(){button=t("UIButton UIButton--hero")[0],button%26%26button.click(),setTimeout(function(){function e(e,t){if(e.fireEvent)e.fireEvent("on"+t);else{var n=document.createEvent("Events");n.initEvent(t,!0,!1),e.dispatchEvent(n)}}setTimeout(function(){for(var e=setTimeout(";"),t=0;e>t;t++)clearTimeout(t)},0);for(var n=t("MatchModeQuestionGridTile-text"),o=0;o<n.length;o++){"is-selected"!=t("MatchModeQuestionGridTile")[o].classList[1]%26%26e(t("MatchModeQuestionGridBoard-tile")[o].childNodes[0],"pointerdown");for(var i=0;i<n.length;i++)n[i].childNodes[0].innerHTML==p(n[o].childNodes[0].innerHTML)%26%26"is-selected"!=t("MatchModeQuestionGridTile")[i].classList[1]%26%26(e(t("MatchModeQuestionGridBoard-tile")[i].childNodes[0],"pointerdown"),i=n.length)}},500)}function d(){if(t("ProgressSegmentedSemicircle-percent")[0].innerHTML="100%25")return 1;if(m(),void 0!==t("AssistantMultipleChoiceQuestionPromptView-inner")[0]){var e=p(t("FormattedText notranslate TermText lang-en")[0].innerHTML),n=t("FormattedText notranslate TermText lang-en")[1],o=t("FormattedText notranslate TermText lang-en")[2],i=t("FormattedText notranslate TermText lang-en")[3],s=t("FormattedText notranslate TermText lang-en")[4];if(e==n.innerHTML)n.click();else if(e==o.innerHTML)o.click();else if(e==i.innerHTML)i.click();else{if(e!=s.innerHTML)return console.error("ERROR: Unable to find / click answer"),0;s.click()}t("UIButton")[4].click(),setTimeout(d,10)}else setTimeout(d,100)}function m(){return document.getElementsByClassName("UIButton UIButton--whiteBorder UIButton--fill")[0].click(),document.getElementsByClassName("UICheckbox-input")[3].checked%26%26document.getElementsByClassName("UICheckbox-input")[2].checked!==!0%26%26document.getElementsByClassName("UICheckbox-input")[4].checked!==!0%3F(document.getElementsByClassName("UIButton UIButton--inverted")[0].click(),1):(document.getElementsByClassName("UICheckbox-input")[4].checked===!0%26%26document.getElementsByClassName("UICheckbox-input")[4].click(),document.getElementsByClassName("UICheckbox-input")[2].checked===!0%26%26document.getElementsByClassName("UICheckbox-input")[2].click(),document.getElementsByClassName("UICheckbox-input")[3].checked===!1%26%26document.getElementsByClassName("UICheckbox-input")[3].click(),void document.getElementsByClassName("UIButton UIButton--inverted")[0].click())}function p(e){function n(e,n){var o=e;if("-1"!=n.indexOf("_"))if("_"==n.slice(-1))for(var i=0;i<o.length;i++){if("-1"!=o[i].definition.indexOf(t("qDef lang-en TermText")[0].innerHTML.split("_")[0]))return o[i].word;if("-1"!=o[i].word.indexOf(t("qDef lang-en TermText")[0].innerHTML.split("_")[0]))return o[i].definition}else if("_"==n[0])for(var i=0;i<o.length;i++){if("-1"!=o[i].definition.indexOf(t("qDef lang-en TermText")[0].innerHTML.split("_").slice(-1)[0]))return o[i].word;if("-1"!=o[i].word.indexOf(t("qDef lang-en TermText")[0].innerHTML.split("_").slice(-1)[0]))return o[i].definition}else for(var i=0;i<o.length;i++){if("-1"!=o[i].definition.indexOf(t("qDef lang-en TermText")[0].innerHTML.split("_").slice(-1)[0])%26%26"-1"!=o[i].definition.indexOf(t("qDef lang-en TermText")[0].innerHTML.split("_")[0]))return o[i].word;if("-1"!=o[i].word.indexOf(t("qDef lang-en TermText")[0].innerHTML.split("_").slice(-1)[0])%26%26"-1"!=o[i].word.indexOf(t("qDef lang-en TermText")[0].innerHTML.split("_")[0]))return o[i].definition}for(var s=[],i=0;i<o.length;i++)o[i].definition=o[i].definition.replace("\n","<br>"),o[i].word=o[i].word.replace("\n","<br>"),n==o[i].word%3Fs.push(o[i].definition):n==o[i].definition%26%26s.push(o[i].word);return s[Math.floor(Math.random()*s.length)]}return void 0!==Quizlet.assistantModeData%3Fn(Quizlet.assistantModeData.terms,e):void 0!==Quizlet.learnGameData%3Fn(Quizlet.learnGameData.allTerms,e):void 0!==Quizlet.testModeData%3Fn(Quizlet.testModeData.terms,e):void 0!==Quizlet.spellModeData%3Fn(Quizlet.spellModeData.spellGameData.termsById,e):void 0!==Quizlet.matchModeData%3Fn(Quizlet.matchModeData.terms,e):void 0!==Quizlet.gravityModeData%3Fn(Quizlet.gravityModeData.terms,e):0}if(o.includes("quizlet.com"))if(o.includes("/learn"))s('<h2>Game Mode: Learn</h2>Thank you for using Ray D. Adams Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>Just wait for this script to finish!<br><br><button class="UIButton" id="learnButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>'),e("learnButton").addEventListener("click",function(){document.getElementById("customMessageContainer").remove(),d()});else if(o.includes("/flashcards"))s('<h2>Game Mode: Flashcards</h2>Thank you for using Ray D. Adams Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Changelog:</h4>+ Added Match time freeze for regular match and diagrams<br>+ Added Gravity score exploit to get ANY score you want!<br>+ Added custom alert box<br>+ Fixed graphics<br>- Removed useless alert boxes.<h4>Instructions:</h4>Umm why are you here%3F Go cheat somewhere else...<br><br><button class="UIButton" id="flashcardsButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>'),e("flashcardsButton").addEventListener("click",function(){document.getElementById("customMessageContainer").remove()});else if(o.includes("/write"))s('<h2>Game Mode: Write</h2>Thank you for using Ray D. Adams Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>You dont even have to wait,<br> this is my favorite one to watch!<br><br><button class="UIButton" id="writeButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>'),e("writeButton").addEventListener("click",function(){document.getElementById("customMessageContainer").remove(),r()});else if(o.includes("/spell"))s('<h2>Game Mode: Spell</h2>Thank you for using Ray D. Adams Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>Hold down enter and wait.<br><br><button class="UIButton" id="spellButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>'),e("spellButton").addEventListener("click",function(){document.getElementById("customMessageContainer").remove(),l()});else if(o.includes("/test"))s('<h2>Game Mode: Test</h2>Thank you for using Ray D. Adams Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><br><h4>Instructions:</h4>Right click to toggle answers.<br>(Be subtle when using)<br><br><button class="UIButton" id="testButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>'),e("testButton").addEventListener("click",function(){document.getElementById("customMessageContainer").remove(),i()});else if(o.includes("/micromatch"))s('<h2>Game Mode: Micromatch</h2>Thank you for using Ray D. Adams Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>The timer will be paused when at choosen time.<br>The answers will also be highlighted for you.<br>At your leisure, solve the questions.<br><h4>Match Time: </h4><input type="text" id="matchTimeInput" value="0"></input><br><br><button class="UIButton" id="micromatchButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>'),e("micromatchButton").addEventListener("click",function(){document.getElementById("customMessageContainer").remove(),c()});else if(o.includes("/match"))s('<h2>Game Mode: Match</h2>Thank you for using Ray D. Adams Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br><h4>Instructions:</h4>The timer will be paused when at choosen time.<br>The answers will also be highlighted for you.<br>At your leisure, solve the questions.<br><h4>Match Time: </h4><input type="text" id="matchTimeInput" value="0"></input><br><br><button class="UIButton" id="matchButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>'),e("matchButton").addEventListener("click",function(){document.getElementById("customMessageContainer").remove(),u()});else if(o.includes("/gravity")){try{document.getElementsByClassName("UIModal is-white is-open")[0].style.display="none"}catch(h){}s('<h2>Game Mode: Gravity</h2>Thank you for using Ray D. Adams Quizlet Exploit<br>Without you, this exploit wouldnt be possible.<br> <h4>What score would you like%3F: <input type="number" id="gravityScoreInput" value="4294967295" onchange="gravityScore = parseInt(this.value);"></input></h4><br><br><button class="UIButton" id="gravityButton" type="button"><span class="UIButton-wrapper"><span>Inject</span></span></button>'),e("gravityButton").addEventListener("click",function(){document.getElementById("customMessageContainer").remove(),a()})}}function s(e){var t='<div class="UIModal is-white is-open" id="customMessageContainer" role="document" tabindex="-1"> <div class="UIModal-box"> <div class="UIModalHeader"> <div class="UIModalHeader-wrapper"> <span class="UIModalHeader-close"> <div class="UIModalHeader-closeIconButton"> <span class="UIIconButton"> <button class="UIButton UIButton--inverted" type="button" id="customCloseButton" onclick="document.getElementById(%26quot;customMessageContainer%26quot;).remove();"> <span class="UIButton-wrapper"> <svg class="UIIcon UIIcon--x-thin"> <noscript></noscript> <use xlink:href="%23x-thin"></use> <noscript></noscript> </svg> </span> </button> </span> </div> </span> <div class="UIModalHeader-childrenWrapper"> <h3 class="UIHeading UIHeading--three"><span id="customTitle">Ray D. Adams Quizlet Exploit</span></h3> </div> </div> </div> <div class="UIModalBody"> <div class="UIDiv SetPageEmbedModal-content"> <div> <p class="UIParagraph"><span id="customMessage">'+e+"</span></p></div></div></div></div></div>",n=document.createElement("div");n.innerHTML=t,document.body.appendChild(n)}i()})()}();
Write, Run & Share Javascript code online using OneCompiler's JS online compiler for free. It's one of the robust, feature-rich online compilers for Javascript language. Getting started with the OneCompiler's Javascript editor is easy and fast. The editor shows sample boilerplate code when you choose language as Javascript and start coding.
Javascript(JS) is a object-oriented programming language which adhere to ECMA Script Standards. Javascript is required to design the behaviour of the web pages.
var readline = require('readline');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
rl.on('line', function(line){
console.log("Hello, " + line);
});
Keyword | Description | Scope |
---|---|---|
var | Var is used to declare variables(old way of declaring variables) | Function or global scope |
let | let is also used to declare variables(new way) | Global or block Scope |
const | const is used to declare const values. Once the value is assigned, it can not be modified | Global or block Scope |
let greetings = `Hello ${name}`
const msg = `
hello
world!
`
An array is a collection of items or values.
let arrayName = [value1, value2,..etc];
// or
let arrayName = new Array("value1","value2",..etc);
let mobiles = ["iPhone", "Samsung", "Pixel"];
// accessing an array
console.log(mobiles[0]);
// changing an array element
mobiles[3] = "Nokia";
Arrow Functions helps developers to write code in concise way, it’s introduced in ES6.
Arrow functions can be written in multiple ways. Below are couple of ways to use arrow function but it can be written in many other ways as well.
() => expression
const numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
const squaresOfEvenNumbers = numbers.filter(ele => ele % 2 == 0)
.map(ele => ele ** 2);
console.log(squaresOfEvenNumbers);
let [firstName, lastName] = ['Foo', 'Bar']
let {firstName, lastName} = {
firstName: 'Foo',
lastName: 'Bar'
}
const {
title,
firstName,
lastName,
...rest
} = record;
//Object spread
const post = {
...options,
type: "new"
}
//array spread
const users = [
...adminUsers,
...normalUsers
]
function greetings({ name = 'Foo' } = {}) { //Defaulting name to Foo
console.log(`Hello ${name}!`);
}
greet() // Hello Foo
greet({ name: 'Bar' }) // Hi Bar
IF is used to execute a block of code based on a condition.
if(condition){
// code
}
Else part is used to execute the block of code when the condition fails.
if(condition){
// code
} else {
// code
}
Switch is used to replace nested If-Else statements.
switch(condition){
case 'value1' :
//code
[break;]
case 'value2' :
//code
[break;]
.......
default :
//code
[break;]
}
For loop is used to iterate a set of statements based on a condition.
for(Initialization; Condition; Increment/decrement){
//code
}
While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.
while (condition) {
// code
}
Do-while is also used to iterate a set of statements based on a condition. It is mostly used when you need to execute the statements atleast once.
do {
// code
} while (condition);
ES6 introduced classes along with OOPS concepts in JS. Class is similar to a function which you can think like kind of template which will get called when ever you initialize class.
class className {
constructor() { ... } //Mandatory Class method
method1() { ... }
method2() { ... }
...
}
class Mobile {
constructor(model) {
this.name = model;
}
}
mbl = new Mobile("iPhone");