console.log("Hello, World!");<div jsmodel="CP1oW" data-params="%.@.[490470758,"¿Qué artículos de la Ley Crecer Juntos comprenden los Principios Rectores?",null,2,[[1740190710,[["a) Art. 1 al 8.",null,null,null,false],["b) Art. 9 al 15.",null,null,null,false],["c) Art. 16 al 20.",null,null,null,false],["d) Art. 25 al 30.",null,null,null,false]],true,[],[],null,null,null,false,null,[null,[]]]],null,null,null,[],null,null,[null,"\u003cspan style\u003d\"white-space:pre-wrap\"\u003e\u003cb\u003e¿Qué artículos de la Ley Crecer Juntos comprenden los Principios Rectores?\u003c/b\u003e\u003c/span\u003e\u003cbr\u003e"]],"i5","i6","i7",true]"><div jscontroller="sWGJ4b" jsaction="EEvAHc:yfX9oc;" jsname="WsjYwc" class="geS5n AFppSc"><div class="z12JJ"><div class="M4DNQ"><div id="i5" class="HoXoMd D1wxyf RjsPE" role="heading" aria-level="3" aria-describedby="i8"><span class="M7eMe"><span style="white-space:pre-wrap"><b>¿Qué artículos de la Ley Crecer Juntos comprenden los Principios Rectores?</b></span><br></span><span class="vnumgf" id="i8" aria-label="Pregunta obligatoria"> *</span></div><div class="gubaDc OIC90c RjsPE" id="i6"></div></div><div class="nUvMO FUQCPb" role="note" aria-label="Total de puntos que se pueden obtener con esta pregunta.">2 puntos</div></div><div jscontroller="UmOCme" jsaction="rcuQ6b:vZc4S;O22p3e:zjh6rb;b2trFe:eVidQc;JIbuQc:RgMCxe(YlCLKb);sPvj8e:d3sQLd;TYy3Ne:RgMCxe;" class="oyXaNc" jsname="GCYh9b"><input type="hidden" name="entry.1740190710_sentinel" jsname="DTMEae"><div jscontroller="eFy6Rc" jsaction="sPvj8e:Gh295d" jsname="cnAzRb"><div class="lLfZXe fnxRtf cNDBpf" jscontroller="wPRNsd" jsshadow="" jsaction="keydown: I481le;JIbuQc:JIbuQc;rcuQ6b:rcuQ6b" jsname="wCJL8" aria-labelledby="i5" aria-describedby="i6 i7" aria-required="true" role="radiogroup"><span jsslot="" role="presentation" jsname="bN97Pc" class="H2Gmcc tyNBNd"><div class="SG0AAe"><div class="nWQGrd zwllIb"><label for="i9" class="docssharedWizToggleLabeledContainer ajBQVb"><div class="bzfPab wFGF8"><div class="d7L4fc bJNwt FXLARc aomaEc ECvBRb"><div id="i9" class="Od2TWd hYsg7c i9xfbb" jscontroller="EcW08c" jsaction="keydown:I481le;dyRcpb:dyRcpb;click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue; focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;" jsshadow="" aria-label="a) Art. 1 al 8." data-value="a) Art. 1 al 8." role="radio" aria-checked="false" aria-posinset="1" aria-setsize="4" tabindex="-1"><div class="x0k1lc MbhUzd"></div><div class="uyywbd"></div><div class="vd3tt"><div class="AB7Lab Id5V1"><div class="rseUEf nQOrEb"></div></div></div></div></div><div class="YEVVod"><div class="ulDsOb"><span dir="auto" class="aDTYNe snByac OvPDhc OIC90c">a) Art. 1 al 8.</span></div></div></div></label></div><div class="nWQGrd zwllIb"><label for="i12" class="docssharedWizToggleLabeledContainer ajBQVb N2RpBe"><div class="bzfPab wFGF8"><div class="d7L4fc bJNwt FXLARc aomaEc ECvBRb"><div id="i12" class="Od2TWd hYsg7c i9xfbb N2RpBe" jscontroller="EcW08c" jsaction="keydown:I481le;dyRcpb:dyRcpb;click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue; focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;" jsshadow="" aria-label="b) Art. 9 al 15." data-value="b) Art. 9 al 15." role="radio" aria-checked="true" aria-posinset="2" aria-setsize="4" tabindex="0"><div class="x0k1lc MbhUzd"></div><div class="uyywbd"></div><div class="vd3tt"><div class="AB7Lab Id5V1"><div class="rseUEf nQOrEb"></div></div></div></div></div><div class="YEVVod"><div class="ulDsOb"><span dir="auto" class="aDTYNe snByac OvPDhc OIC90c">b) Art. 9 al 15.</span></div></div></div></label></div><div class="nWQGrd zwllIb"><label for="i15" class="docssharedWizToggleLabeledContainer ajBQVb"><div class="bzfPab wFGF8"><div class="d7L4fc bJNwt FXLARc aomaEc ECvBRb"><div id="i15" class="Od2TWd hYsg7c i9xfbb" jscontroller="EcW08c" jsaction="keydown:I481le;dyRcpb:dyRcpb;click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue; focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;" jsshadow="" aria-label="c) Art. 16 al 20." data-value="c) Art. 16 al 20." role="radio" aria-checked="false" aria-posinset="3" aria-setsize="4" tabindex="-1"><div class="x0k1lc MbhUzd"></div><div class="uyywbd"></div><div class="vd3tt"><div class="AB7Lab Id5V1"><div class="rseUEf nQOrEb"></div></div></div></div></div><div class="YEVVod"><div class="ulDsOb"><span dir="auto" class="aDTYNe snByac OvPDhc OIC90c">c) Art. 16 al 20.</span></div></div></div></label></div><div class="nWQGrd zwllIb"><label for="i18" class="docssharedWizToggleLabeledContainer ajBQVb"><div class="bzfPab wFGF8"><div class="d7L4fc bJNwt FXLARc aomaEc ECvBRb"><div id="i18" class="Od2TWd hYsg7c i9xfbb" jscontroller="EcW08c" jsaction="keydown:I481le;dyRcpb:dyRcpb;click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue; focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;" jsshadow="" aria-label="d) Art. 25 al 30." data-value="d) Art. 25 al 30." role="radio" aria-checked="false" aria-posinset="4" aria-setsize="4" tabindex="-1"><div class="x0k1lc MbhUzd"></div><div class="uyywbd"></div><div class="vd3tt"><div class="AB7Lab Id5V1"><div class="rseUEf nQOrEb"></div></div></div></div></div><div class="YEVVod"><div class="ulDsOb"><span dir="auto" class="aDTYNe snByac OvPDhc OIC90c">d) Art. 25 al 30.</span></div></div></div></label></div></div></span></div></div></div><div jsname="Rfh2Tc" class="SL4Sz" id="i7" role="alert"></div></div></div>
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");