-
Notifications
You must be signed in to change notification settings - Fork 47
Functions #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Functions #75
Changes from 15 commits
c594079
e2877f1
722a4e1
906f4e8
0c4bd5e
1e5439e
fbb4ea7
f0d15ad
952f447
74b6581
b632892
1d42753
93aa7be
f39ab2b
5bf0d16
badd33b
1eac281
de48b64
dc463a3
300a818
582983e
c8a43e6
1b5f2a9
97871c6
4dd3856
6b4f682
1ff58cc
5601c33
6913971
f9696dd
56a438d
c8ecd51
7b70801
270a393
ac357ca
0588885
7611a3f
3ad84fb
e37cbf2
a04785d
d5900ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
No difference. | ||
कोई फर्क नहीं। |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
Using a question mark operator `'?'`: | ||
प्रश्न चिह्न ऑपरेटर का उपयोग करते हुए `?`: | ||
|
||
```js | ||
function checkAge(age) { | ||
return (age > 18) ? true : confirm('Did parents allow you?'); | ||
return (age > 18) ? true : confirm('क्या माता-पिता ने आपको अनुमति दी थी?'); | ||
} | ||
``` | ||
|
||
Using OR `||` (the shortest variant): | ||
OR ऑपरेटर का उपयोग करते हुए `||` (सबसे छोटा संस्करण) | ||
|
||
```js | ||
function checkAge(age) { | ||
return (age > 18) || confirm('Did parents allow you?'); | ||
return (age > 18) || confirm('क्या माता-पिता ने आपको अनुमति दी थ?'); | ||
} | ||
``` | ||
|
||
Note that the parentheses around `age > 18` are not required here. They exist for better readabilty. | ||
ध्यान दें कि यहां `age > 18` के आसपास के कोष्ठकों की आवश्यकता नहीं है। वे बेहतर पठनीयता के लिए मौजूद हैं। |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,12 @@ importance: 1 | |
|
||
# Function min(a, b) | ||
|
||
Write a function `min(a,b)` which returns the least of two numbers `a` and `b`. | ||
एक function लिखें `min(a,b)` जो कम से कम दो नंबर `a` और `b` लौटाता है। | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you have a re-look at this line? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
For instance: | ||
उदाहरण के लिए: | ||
|
||
```js | ||
min(2, 5) == 2 | ||
min(3, -1) == -1 | ||
min(1, 1) == 1 | ||
``` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,16 +4,16 @@ importance: 4 | |
|
||
# Function pow(x,n) | ||
|
||
Write a function `pow(x,n)` that returns `x` in power `n`. Or, in other words, multiplies `x` by itself `n` times and returns the result. | ||
एक function लिखें `pow(x,n)` जो `x` को `n` के शक्ति में लौटाता है। या, दूसरे शब्दों में, `x` को अपने आप से `n` गुणा से गुणा करता है और परिणाम देता है। | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This line also needs to be re-looked. Let's try to use proper mathematical terms in Hindi There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
```js | ||
pow(3, 2) = 3 * 3 = 9 | ||
pow(3, 3) = 3 * 3 * 3 = 27 | ||
pow(1, 100) = 1 * 1 * ...* 1 = 1 | ||
``` | ||
|
||
Create a web-page that prompts for `x` and `n`, and then shows the result of `pow(x,n)`. | ||
एक वेब-पेज बनाएं जो `x` और `n` के लिए संकेत देता है, और फिर `pow(x,n)` का परिणाम दिखाता है। | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I think you are right. It is better to keep it as is. |
||
|
||
[demo] | ||
|
||
P.S. In this task the function should support only natural values of `n`: integers up from `1`. | ||
नोट: इस टास्क में function को केवल `n` के प्राकृतिक मान का समर्थन करना चाहिए: `1` से ऊपर के पूर्णांक। | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above math terms are translated as plain old english. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use something more explicit than
प्रदर्शन
? The translation doesn't need to match word by word if it's restricting us to convey the info.